sched, drivers: Remove max param from effective_cpu_util()/sched_cpu_util()
authorDietmar Eggemann <dietmar.eggemann@arm.com>
Tue, 21 Jun 2022 09:04:10 +0000 (10:04 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 28 Jun 2022 07:17:46 +0000 (09:17 +0200)
commitbb4479994945e9170534389a7762eb56149320ac
tree949e049d67ea05825d5893bda35ddf8e4bd94040
parente2f3e35f1f5a4dccddf352cea534542544c9b867
sched, drivers: Remove max param from effective_cpu_util()/sched_cpu_util()

effective_cpu_util() already has a `int cpu' parameter which allows to
retrieve the CPU capacity scale factor (or maximum CPU capacity) inside
this function via an arch_scale_cpu_capacity(cpu).

A lot of code calling effective_cpu_util() (or the shim
sched_cpu_util()) needs the maximum CPU capacity, i.e. it will call
arch_scale_cpu_capacity() already.
But not having to pass it into effective_cpu_util() will make the EAS
wake-up code easier, especially when the maximum CPU capacity reduced
by the thermal pressure is passed through the EAS wake-up functions.

Due to the asymmetric CPU capacity support of arm/arm64 architectures,
arch_scale_cpu_capacity(int cpu) is a per-CPU variable read access via
per_cpu(cpu_scale, cpu) on such a system.
On all other architectures it is a a compile-time constant
(SCHED_CAPACITY_SCALE).

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://lkml.kernel.org/r/20220621090414.433602-4-vdonnefort@google.com
drivers/powercap/dtpm_cpu.c
drivers/thermal/cpufreq_cooling.c
include/linux/sched.h
kernel/sched/core.c
kernel/sched/cpufreq_schedutil.c
kernel/sched/fair.c
kernel/sched/sched.h