diff options
author | Ingo Molnar <mingo@kernel.org> | 2020-03-06 14:26:31 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-03-06 14:26:31 +0100 |
commit | 14533a16c46db70b8a75eda8fa633c25ac446d81 (patch) | |
tree | 05f2121243644072c6dd4d316d39c999b103a79d /kernel/sched | |
parent | d94a9df49069ba8ff7c4aaeca1229e6471a01a15 (diff) | |
download | linux-14533a16c46db70b8a75eda8fa633c25ac446d81.tar.bz2 |
thermal/cpu-cooling, sched/core: Move the arch_set_thermal_pressure() API to generic scheduler code
drivers/base/arch_topology.c is only built if CONFIG_GENERIC_ARCH_TOPOLOGY=y,
resulting in such build failures:
cpufreq_cooling.c:(.text+0x1e7): undefined reference to `arch_set_thermal_pressure'
Move it to sched/core.c instead, and keep it enabled on x86 despite
us not having a arch_scale_thermal_pressure() facility there, to
build-test this thing.
Cc: Thara Gopinath <thara.gopinath@linaro.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/core.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 4d76df33418e..978bf6f6e0ff 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3576,6 +3576,17 @@ unsigned long long task_sched_runtime(struct task_struct *p) return ns; } +DEFINE_PER_CPU(unsigned long, thermal_pressure); + +void arch_set_thermal_pressure(struct cpumask *cpus, + unsigned long th_pressure) +{ + int cpu; + + for_each_cpu(cpu, cpus) + WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure); +} + /* * This function gets called by the timer code, with HZ frequency. * We call it with interrupts disabled. |