Skip to content

Commit e21cf43

Browse files
vingu-linarosuryasaimadhu
authored andcommitted
sched/cfs: change initial value of runnable_avg
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 <[email protected]> Signed-off-by: Vincent Guittot <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8c4890d commit e21cf43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ void post_init_entity_util_avg(struct task_struct *p)
806806
}
807807
}
808808

809-
sa->runnable_avg = cpu_scale;
809+
sa->runnable_avg = sa->util_avg;
810810

811811
if (p->sched_class != &fair_sched_class) {
812812
/*

0 commit comments

Comments
 (0)