]> git.baikalelectronics.ru Git - kernel.git/commit
sched/fair: Add ancestors of unthrottled undecayed cfs_rq
authorMichal Koutný <mkoutny@suse.com>
Fri, 17 Sep 2021 15:30:37 +0000 (17:30 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 1 Oct 2021 11:57:57 +0000 (13:57 +0200)
commitd2086d6b46832c40fbe38ac45461141b0e0ba5d4
treea6f12bb83bd6ab53a0e94286a38acdba3e618205
parentfa5d4460cfe6a4ab811a36d49fe44ccb61944b70
sched/fair: Add ancestors of unthrottled undecayed cfs_rq

Since commit 398f958d7ef7 ("sched/fair: Correctly insert cfs_rq's to
list on unthrottle") we add cfs_rqs with no runnable tasks but not fully
decayed into the load (leaf) list. We may ignore adding some ancestors
and therefore breaking tmp_alone_branch invariant. This broke LTP test
cfs_bandwidth01 and it was partially fixed in commit 6e4117360243
("sched/fair: Ensure that the CFS parent is added after unthrottling").

I noticed the named test still fails even with the fix (but with low
probability, 1 in ~1000 executions of the test). The reason is when
bailing out of unthrottle_cfs_rq early, we may miss adding ancestors of
the unthrottled cfs_rq, thus, not joining tmp_alone_branch properly.

Fix this by adding ancestors if we notice the unthrottled cfs_rq was
added to the load list.

Fixes: 398f958d7ef7 ("sched/fair: Correctly insert cfs_rq's to list on unthrottle")
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Odin Ugedal <odin@uged.al>
Link: https://lore.kernel.org/r/20210917153037.11176-1-mkoutny@suse.com
kernel/sched/fair.c