Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arch_topology: Remove unused topology_set_thermal_pressure() and related

There is no need of this function (and related) since code has been
converted to use the new arch_update_thermal_pressure() API. The old
code can be removed.

Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

authored by

Lukasz Luba and committed by
Viresh Kumar
7e97b3dc 0258cb19

+6 -25
-1
arch/arm/include/asm/topology.h
··· 23 23 24 24 /* Replace task scheduler's default thermal pressure API */ 25 25 #define arch_scale_thermal_pressure topology_get_thermal_pressure 26 - #define arch_set_thermal_pressure topology_set_thermal_pressure 27 26 #define arch_update_thermal_pressure topology_update_thermal_pressure 28 27 29 28 #else
-1
arch/arm64/include/asm/topology.h
··· 32 32 33 33 /* Replace task scheduler's default thermal pressure API */ 34 34 #define arch_scale_thermal_pressure topology_get_thermal_pressure 35 - #define arch_set_thermal_pressure topology_set_thermal_pressure 36 35 #define arch_update_thermal_pressure topology_update_thermal_pressure 37 36 38 37 #include <asm-generic/topology.h>
+5 -12
drivers/base/arch_topology.c
··· 156 156 157 157 DEFINE_PER_CPU(unsigned long, thermal_pressure); 158 158 159 - void topology_set_thermal_pressure(const struct cpumask *cpus, 160 - unsigned long th_pressure) 161 - { 162 - int cpu; 163 - 164 - for_each_cpu(cpu, cpus) 165 - WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure); 166 - } 167 - EXPORT_SYMBOL_GPL(topology_set_thermal_pressure); 168 - 169 159 /** 170 160 * topology_update_thermal_pressure() - Update thermal pressure for CPUs 171 161 * @cpus : The related CPUs for which capacity has been reduced ··· 173 183 void topology_update_thermal_pressure(const struct cpumask *cpus, 174 184 unsigned long capped_freq) 175 185 { 176 - unsigned long max_capacity, capacity; 186 + unsigned long max_capacity, capacity, th_pressure; 177 187 u32 max_freq; 178 188 int cpu; 179 189 ··· 193 203 else 194 204 capacity = mult_frac(max_capacity, capped_freq, max_freq); 195 205 196 - arch_set_thermal_pressure(cpus, max_capacity - capacity); 206 + th_pressure = max_capacity - capacity; 207 + 208 + for_each_cpu(cpu, cpus) 209 + WRITE_ONCE(per_cpu(thermal_pressure, cpu), th_pressure); 197 210 } 198 211 EXPORT_SYMBOL_GPL(topology_update_thermal_pressure); 199 212
-3
include/linux/arch_topology.h
··· 56 56 return per_cpu(thermal_pressure, cpu); 57 57 } 58 58 59 - void topology_set_thermal_pressure(const struct cpumask *cpus, 60 - unsigned long th_pressure); 61 - 62 59 void topology_update_thermal_pressure(const struct cpumask *cpus, 63 60 unsigned long capped_freq); 64 61
-7
include/linux/sched/topology.h
··· 266 266 } 267 267 #endif 268 268 269 - #ifndef arch_set_thermal_pressure 270 - static __always_inline 271 - void arch_set_thermal_pressure(const struct cpumask *cpus, 272 - unsigned long th_pressure) 273 - { } 274 - #endif 275 - 276 269 #ifndef arch_update_thermal_pressure 277 270 static __always_inline 278 271 void arch_update_thermal_pressure(const struct cpumask *cpus,
+1 -1
init/Kconfig
··· 550 550 i.e. put less load on throttled CPUs than on non/less throttled ones. 551 551 552 552 This requires the architecture to implement 553 - arch_set_thermal_pressure() and arch_scale_thermal_pressure(). 553 + arch_update_thermal_pressure() and arch_scale_thermal_pressure(). 554 554 555 555 config BSD_PROCESS_ACCT 556 556 bool "BSD Process Accounting"