sched/pelt: Ensure that *_sum is always synced with *_avg
authorVincent Guittot <vincent.guittot@linaro.org>
Tue, 1 Jun 2021 08:58:32 +0000 (10:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Jun 2021 12:42:48 +0000 (14:42 +0200)
commit813ff24f1d08cb4b4605fe222bb104a8dbdfd7f5
tree21f1c6754a748ba2646567a3d3dcf1f6578e3db7
parentf6d28f0e36e93570f2843abef9969681860c38e7
sched/pelt: Ensure that *_sum is always synced with *_avg

[ Upstream commit fcf6631f3736985ec89bdd76392d3c7bfb60119f ]

Rounding in PELT calculation happening when entities are attached/detached
of a cfs_rq can result into situations where util/runnable_avg is not null
but util/runnable_sum is. This is normally not possible so we need to
ensure that util/runnable_sum stays synced with util/runnable_avg.

detach_entity_load_avg() is the last place where we don't sync
util/runnable_sum with util/runnbale_avg when moving some sched_entities

Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210601085832.12626-1-vincent.guittot@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/sched/fair.c