msm: thermal: Optimize locking in thermal frequency mitigation thread
Optimize locking in thermal frequency mitigation thread
to reduce lock contention with hotplug mitigation thread.
This lock is not explicitly required since the cpu driver
already have a per cluster lock down the freqency mitigation
call path. This would be much optimized since the new changes
will hold the lock for a shorter period and unlike previously
where the lock was for entire cluster, this is per cluster
lock that will further reduce lock contention. This would
help thermal to do mitigation faster.
Change-Id: I192efa77df8ad9b128759f31300d4a64a558cc16
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
diff --git a/drivers/thermal/msm_thermal.c b/drivers/thermal/msm_thermal.c
index f2fb09d..0652410 100644
--- a/drivers/thermal/msm_thermal.c
+++ b/drivers/thermal/msm_thermal.c
@@ -1546,7 +1546,6 @@
;
INIT_COMPLETION(freq_mitigation_complete);
- get_online_cpus();
for_each_possible_cpu(cpu) {
max_freq_req = (cpus[cpu].max_freq) ?
msm_thermal_info.freq_limit :
@@ -1574,7 +1573,6 @@
cpus[cpu].freq_thresh_clear = false;
}
}
- put_online_cpus();
}
return ret;
}