summaryrefslogtreecommitdiff
path: root/kernel/sched/autogroup.h
diff options
context:
space:
mode:
authorChengming Zhou <zhouchengming@bytedance.com>2022-08-18 20:48:01 +0800
committerPeter Zijlstra <peterz@infradead.org>2022-08-23 11:01:18 +0200
commite1f078f50478a51849453341e7356cb298df00cf (patch)
tree2e35fc08323e427b0b88baca28caeb4ae830df1f /kernel/sched/autogroup.h
parent859f206290f345c151a6005de639ba9677bf3e18 (diff)
sched/fair: Combine detach into dequeue when migrating task
When we are migrating task out of the CPU, we can combine detach and propagation into dequeue_entity() to save the detach_entity_cfs_rq() in migrate_task_rq_fair(). This optimization is like combining DO_ATTACH in the enqueue_entity() when migrating task to the CPU. So we don't have to traverse the CFS tree extra time to do the detach_entity_cfs_rq() -> propagate_entity_cfs_rq(), which wouldn't be called anymore with this patch's change. detach_task() deactivate_task() dequeue_task_fair() for_each_sched_entity(se) dequeue_entity() update_load_avg() /* (1) */ detach_entity_load_avg() set_task_cpu() migrate_task_rq_fair() detach_entity_cfs_rq() /* (2) */ update_load_avg(); detach_entity_load_avg(); propagate_entity_cfs_rq(); for_each_sched_entity() update_load_avg() This patch save the detach_entity_cfs_rq() called in (2) by doing the detach_entity_load_avg() for a CPU migrating task inside (1) (the task being the first se in the loop) Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org> Link: https://lore.kernel.org/r/20220818124805.601-6-zhouchengming@bytedance.com
Diffstat (limited to 'kernel/sched/autogroup.h')
0 files changed, 0 insertions, 0 deletions