sched/cfs: change initial value of runnable_avg
authorVincent Guittot <vincent.guittot@linaro.org>
Wed, 24 Jun 2020 15:44:22 +0000 (17:44 +0200)
committerSasha Levin <sashal@kernel.org>
Tue, 30 Jun 2020 19:36:13 +0000 (15:36 -0400)
commitf3f0e114c088da075998e9dcf1d5ce6ee6a754ee
treed37c5bb71f0e0a971a688c826301d185e63477ff
parent3fa41459aa64de784d68cb87ea6a6d3a3e38e5e3
sched/cfs: change initial value of runnable_avg

[ Upstream commit e21cf43406a190adfcc4bfe592768066fb3aaa9b ]

Some performance regression on reaim benchmark have been raised with
  commit 070f5e860ee2 ("sched/fair: Take into account runnable_avg to classify group")

The problem comes from the init value of runnable_avg which is initialized
with max value. This can be a problem if the newly forked task is finally
a short task because the group of CPUs is wrongly set to overloaded and
tasks are pulled less agressively.

Set initial value of runnable_avg equals to util_avg to reflect that there
is no waiting time so far.

Fixes: 070f5e860ee2 ("sched/fair: Take into account runnable_avg to classify group")
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200624154422.29166-1-vincent.guittot@linaro.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/sched/fair.c