sched/fair: Refactor cpu_util_without()
authorDietmar Eggemann <dietmar.eggemann@arm.com>
Fri, 18 Mar 2022 16:36:56 +0000 (17:36 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 29 Apr 2022 09:06:29 +0000 (11:06 +0200)
commit4e3c7d338a2260406ae22eaf6d77b639d59bdc7e
tree8676bb89ff7df00aac722a36427897396b9d26b6
parenta658353167bf2ea6052cee071dbcc13e0f229dc9
sched/fair: Refactor cpu_util_without()

Except the 'task has no contribution or is new' condition at the
beginning of cpu_util_without(), which it shares with the load and
runnable counterpart functions, a cpu_util_next(..., dst_cpu = -1)
call can replace the rest of it.

The UTIL_EST specific check that task util_est has to be subtracted
from the CPU one in case of an enqueued (or current (to cater for the
wakeup - lb race)) task has to be moved to cpu_util_next().
This was initially introduced by commit c469933e7721
("sched/fair: Fix cpu_util_wake() for 'execl' type workloads").
UnixBench's `execl` throughput tests were run on the dual socket 40
CPUs Intel E5-2690 v2 to make sure it doesn't regress again.

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20220318163656.954440-1-dietmar.eggemann@arm.com
kernel/sched/fair.c