【问题标题】:linux CFS schedular: if the task is scheduled based on vruntime then how task priority is used for schedulinglinux CFS schedular:如果任务是基于 vruntime 调度的,那么如何使用任务优先级进行调度
【发布时间】:2015-02-12 06:56:15
【问题描述】:
linux CFS 调度如果最低运行(vruntime)任务被调度,那么任务优先级如何用于调度或根本不使用。
可运行的任务被添加到 rbtree 中,以 vmtime 为键,最低的 vmtime 任务将被保留在最被调度的位置。如果是这种情况,如何使用任务的优先级来调度任务。
提前致谢。
拉梅什
【问题讨论】:
标签:
linux-kernel
scheduler
【解决方案1】:
我认为进程的优先级是 vruntime 计算的一部分。参考
What is the concept of vruntime in CFS
具体看calc_delta_fair()下面的代码
delta_exec_weighed = delta_exec * (NICE_0_LOAD / curr->load.weight)
具有高优先级(nice 值较低)的任务将获得更大的权重,因此占它们的 vrumtime 会更小。有关详细信息,请参阅图 2.18 及其周围的文字。