Skip to content
Commit 4c2fdf73 authored by Liao Chang's avatar Liao Chang Committed by Rafael J. Wysocki
Browse files

cpufreq: pcc: Fix the potentinal scheduling delays in target_index()



pcc_cpufreq_target():
	cpufreq_freq_transition_begin();
	spin_lock(&pcc_lock);
	[critical section]
	cpufreq_freq_transition_end();
	spin_unlock(&pcc_lock);

Above code has a performance issue, consider that Task0 executes
'cpufreq_freq_transition_end()' to wake Task1 and preempted imediatedly
without releasing 'pcc_lock', then Task1 needs to wait for Task0 to
release 'pcc_lock'. In the worst case, this locking order can result in
Task1 wasting two scheduling rounds before it can enter the critical
section.

Signed-off-by: default avatarLiao Chang <liaochang1@huawei.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 916f1388
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment