Skip to content

Commit 71c751c

Browse files
vingu-linarogregkh
authored andcommitted
sched/fair: Make sure to update tg contrib for blocked load
commit 02da26a upstream. During the update of fair blocked load (__update_blocked_fair()), we update the contribution of the cfs in tg->load_avg if cfs_rq's pelt has decayed. Nevertheless, the pelt values of a cfs_rq could have been recently updated while propagating the change of a child. In this case, cfs_rq's pelt will not decayed because it has already been updated and we don't update tg->load_avg. __update_blocked_fair ... for_each_leaf_cfs_rq_safe: child cfs_rq update cfs_rq_load_avg() for child cfs_rq ... update_load_avg(cfs_rq_of(se), se, 0) ... update cfs_rq_load_avg() for parent cfs_rq -propagation of child's load makes parent cfs_rq->load_sum becoming null -UPDATE_TG is not set so it doesn't update parent cfs_rq->tg_load_avg_contrib .. for_each_leaf_cfs_rq_safe: parent cfs_rq update cfs_rq_load_avg() for parent cfs_rq - nothing to do because parent cfs_rq has already been updated recently so cfs_rq->tg_load_avg_contrib is not updated ... parent cfs_rq is decayed list_del_leaf_cfs_rq parent cfs_rq - but it still contibutes to tg->load_avg we must set UPDATE_TG flags when propagting pending load to the parent Fixes: 039ae8b ("sched/fair: Fix O(nr_cgroups) in the load balancing path") Reported-by: Odin Ugedal <[email protected]> Signed-off-by: Vincent Guittot <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Odin Ugedal <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 26ab08d commit 71c751c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/fair.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7660,7 +7660,7 @@ static bool __update_blocked_fair(struct rq *rq, bool *done)
76607660
/* Propagate pending load changes to the parent, if any: */
76617661
se = cfs_rq->tg->se[cpu];
76627662
if (se && !skip_blocked_update(se))
7663-
update_load_avg(cfs_rq_of(se), se, 0);
7663+
update_load_avg(cfs_rq_of(se), se, UPDATE_TG);
76647664

76657665
/*
76667666
* There can be a lot of idle CPU cgroups. Don't let fully

0 commit comments

Comments
 (0)