Calling task_tick_fair in CFS algorithm

126 Views Asked by At

Why is there a for_each_sched_entity macro in task_tick_fair function called on system tick? According to me, only the run time characteristics of the current task should be updated. Why does it call entity_tick for the entire hierarchy of the current process?

1

There are 1 best solutions below

0
On

CFS supports hierarchies of tasks, where entire subtrees can have their CPU usage accounting and quota aggregated. This features is used to implement cpu cgroups and CFS group scheduling. A interior node of the task tree can be thought of a as a virtual task than represents the CPU usage of its subtree.