summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLukasz Luba <lukasz.luba@arm.com>2021-06-14 20:10:30 +0100
committerPeter Zijlstra <peterz@infradead.org>2021-06-17 14:11:43 +0200
commit2ad8ccc17d1e4270cf65a3f2a07a7534aa23e3fb (patch)
tree3bf363a327cd94889d6cc8c6b16be5ec8d6516b8 /drivers
parent83c5e9d573e1f0757f324d01adb6ee77b49c3f0e (diff)
downloadlinux-2ad8ccc17d1e4270cf65a3f2a07a7534aa23e3fb.tar.bz2
thermal/cpufreq_cooling: Update offline CPUs per-cpu thermal_pressure
The thermal pressure signal gives information to the scheduler about reduced CPU capacity due to thermal. It is based on a value stored in a per-cpu 'thermal_pressure' variable. The online CPUs will get the new value there, while the offline won't. Unfortunately, when the CPU is back online, the value read from per-cpu variable might be wrong (stale data). This might affect the scheduler decisions, since it sees the CPU capacity differently than what is actually available. Fix it by making sure that all online+offline CPUs would get the proper value in their per-cpu variable when thermal framework sets capping. Fixes: f12e4f66ab6a3 ("thermal/cpu-cooling: Update thermal pressure in case of a maximum frequency capping") Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Link: https://lore.kernel.org/r/20210614191030.22241-1-lukasz.luba@arm.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/thermal/cpufreq_cooling.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c
index eeb4e4b76c0b..43b1ae8a7789 100644
--- a/drivers/thermal/cpufreq_cooling.c
+++ b/drivers/thermal/cpufreq_cooling.c
@@ -478,7 +478,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
ret = freq_qos_update_request(&cpufreq_cdev->qos_req, frequency);
if (ret >= 0) {
cpufreq_cdev->cpufreq_state = state;
- cpus = cpufreq_cdev->policy->cpus;
+ cpus = cpufreq_cdev->policy->related_cpus;
max_capacity = arch_scale_cpu_capacity(cpumask_first(cpus));
capacity = frequency * max_capacity;
capacity /= cpufreq_cdev->policy->cpuinfo.max_freq;