我是靠谱客的博主 无辜白昼,这篇文章主要介绍Linux进程sched类的优先级顺序,现在分享给大家,希望可以做个参考。

1  调度器及默认优先级

linux-5.14.4includeasm-genericvmlinux.lds.h      126

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* * The order of the sched class addresses are important, as they are * used to determine the order of the priority of each sched class in * relation to each other. */ #define SCHED_DATA STRUCT_ALIGN(); __begin_sched_classes = .; *(__idle_sched_class) *(__fair_sched_class) *(__rt_sched_class) *(__dl_sched_class) *(__stop_sched_class) // 内核使用 __end_sched_classes = .;

2 每种调度器对应的调度策略

linux-5.14.4kernelschedsched.h        162

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static inline int idle_policy(int policy) { return policy == SCHED_IDLE; } static inline int fair_policy(int policy) { return policy == SCHED_NORMAL || policy == SCHED_BATCH; } static inline int rt_policy(int policy) { return policy == SCHED_FIFO || policy == SCHED_RR; } static inline int dl_policy(int policy) { return policy == SCHED_DEADLINE; } static inline bool valid_policy(int policy) { return idle_policy(policy) || fair_policy(policy) || rt_policy(policy) || dl_policy(policy); }

最后

以上就是无辜白昼最近收集整理的关于Linux进程sched类的优先级顺序的全部内容,更多相关Linux进程sched类内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(86)

评论列表共有 0 条评论

立即
投稿
返回
顶部