linux调度的入口函数时schedule(),定义在文件kernel/sched.c
是内核其它部分用于调用进程调度器的入口:选择哪个进程可以运行,何时将其投入运行
通常需要和一个具体的调度类相关联,一般是优先级最高的,每个调度类都有一个自己的可运行队列
这个函数唯一的作用就是调用pick_next_task,依次检查每个调度器类,并且从最高优先级的调度器类中选择最高优先级的进程运行。。
/*
* Pick up the highest-prio task:
*/
static inline struct task_struct *
pick_next_task(struct rq *rq)
{
const struct sched_class *class;
struct task_struct *p;
/*
* Optimization: we know that if all tasks are in
* the fair class we can call that function directly:
*/
if (likely(rq->nr_running == rq->cfs.nr_running)) {<