Skip to main content
 首页 » 操作系统

Linux 进程调度杂项汇总

2022年07月19日27xing901022

1. sched class与sched policy的对应关系

完全公平调度:SCHED_NORMAL SCHED_BATCH
实时进程调度:SCHED_FIFO SCHED_RR
空闲调度:SCHED_IDLE
Deadline调度: SCHED_DEADLINE

//kernel/sched/sched.h 
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; 
}

本文参考链接:https://www.cnblogs.com/hellokitty2/p/14221203.html