看啥推荐读物
专栏名称: Linux爱好者
伯乐在线旗下账号,「Linux爱好者」专注分享 Linux/Unix 相关内容,包括:工具资源、使用技巧、课程书籍等。
今天看啥  ›  专栏  ›  Linux爱好者

Linux 进程管理之调度和进程切换

Linux爱好者  · 公众号  · linux  · 2021-06-12 11:50
什么是调度?按照某种调度算法,从进程的ready队列中选择进程给CPU。为什么要调度?为了最大限度的利用CPU。调度相关结构体task_struct我们先把task_struct中和调度相关的结构拎出来:struct task_struct { ......  /* *调度类。用 sched_class 对调度器进行抽象  *Stop调度器:stop_sched_class *Deadline调度器:dl_sched_class *RT调度器:rt_sched_class *CFS调度器:cfs_sched_class *IDLE-Task调度器:idle_sched_class */ const struct sched_class *sched_class; //CFS调度实体 struct sched_entity  se; //RT调度实体 struct sched_rt_entity  rt;  ......  #ifdef CONFIG_CGROUP_SCHED //任务组(在每个CPU上都会维护一个CFS调度实体、CFS运行队列; RT调度实体,RT运行队列) struct task_group  *sched_task_group; #endif //DL调度实体 struct sched_dl_ent ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照