thermal/cpufreq_cooling: Update offline CPUs per-cpu thermal_pressure
authorLukasz Luba <lukasz.luba@arm.com>
Mon, 14 Jun 2021 19:10:30 +0000 (20:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:55:47 +0000 (16:55 +0200)
commitf2b240047644ddc62d0652d65b84e9dc42e90a9a
treebbdebd8217d325d3b77fbf1c3168cb216a34a095
parent4eab2e2e98895aea788b0408ad8a1bcf62dd606e
thermal/cpufreq_cooling: Update offline CPUs per-cpu thermal_pressure

[ Upstream commit 2ad8ccc17d1e4270cf65a3f2a07a7534aa23e3fb ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/cpufreq_cooling.c