Skip to content

Commit 14533a1

Browse files
committed
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>
1 parent d94a9df commit 14533a1

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎drivers/base/arch_topology.c‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,6 @@ void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity)
4242
per_cpu(cpu_scale, cpu) = capacity;
4343
}
4444

45-
DEFINE_PER_CPU(unsigned long, thermal_pressure);
46-
47-
void arch_set_thermal_pressure(struct cpumask *cpus,
48-
unsigned long th_pressure)
49-
{
50-
int cpu;
51-
52-
for_each_cpu(cpu, cpus)
53-
WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure);
54-
}
55-
5645
static ssize_t cpu_capacity_show(struct device *dev,
5746
struct device_attribute *attr,
5847
char *buf)

‎kernel/sched/core.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3576,6 +3576,17 @@ unsigned long long task_sched_runtime(struct task_struct *p)
35763576
return ns;
35773577
}
35783578

3579+
DEFINE_PER_CPU(unsigned long, thermal_pressure);
3580+
3581+
void arch_set_thermal_pressure(struct cpumask *cpus,
3582+
unsigned long th_pressure)
3583+
{
3584+
int cpu;
3585+
3586+
for_each_cpu(cpu, cpus)
3587+
WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure);
3588+
}
3589+
35793590
/*
35803591
* This function gets called by the timer code, with HZ frequency.
35813592
* We call it with interrupts disabled.

0 commit comments

Comments
 (0)