Skip to content

Commit

Permalink
cpufreq: qcom-cpufreq-hw: Update offline CPUs per-cpu thermal pressure
Browse files Browse the repository at this point in the history
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 there is throttling
or throttling is removed.

Fixes: 275157b ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support")
Reviewed-by: Thara Gopinath <[email protected]>
Signed-off-by: Lukasz Luba <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
  • Loading branch information
lukaszluba-arm authored and vireshk committed Nov 23, 2021
1 parent 5168b1b commit 93d9e6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/cpufreq/qcom-cpufreq-hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)
if (capacity > max_capacity)
capacity = max_capacity;

arch_set_thermal_pressure(policy->cpus, max_capacity - capacity);
arch_set_thermal_pressure(policy->related_cpus,
max_capacity - capacity);

/*
* In the unlikely case policy is unregistered do not enable
Expand Down

0 comments on commit 93d9e6f

Please sign in to comment.