Skip to content

Commit

Permalink
sched/cfs: change initial value of runnable_avg
Browse files Browse the repository at this point in the history
Some performance regression on reaim benchmark have been raised with
  commit 070f5e8 ("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: 070f5e8 ("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
  • Loading branch information
Vincent Guittot authored and Borislav Petkov committed Jun 28, 2020
1 parent 8c4890d commit e21cf43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ void post_init_entity_util_avg(struct task_struct *p)
}
}

sa->runnable_avg = cpu_scale;
sa->runnable_avg = sa->util_avg;

if (p->sched_class != &fair_sched_class) {
/*
Expand Down

0 comments on commit e21cf43

Please sign in to comment.