cpufreq: schedutil: Avoid missing updates for one-CPU policies
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 23 May 2018 09:47:45 +0000 (11:47 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 24 May 2018 08:21:18 +0000 (10:21 +0200)
commita61dec7447456858dfc88fe056017a91ab903ed0
treecc296fea94a97c09349f4dbf057a61dd2b004f92
parent152db033d77589df9ff1b93c1b311d4cd2e93bd0
cpufreq: schedutil: Avoid missing updates for one-CPU policies

Commit 152db033d775 (schedutil: Allow cpufreq requests to be made
even when kthread kicked) made changes to prevent utilization updates
from being discarded during processing a previous request, but it
left a small window in which that still can happen in the one-CPU
policy case.  Namely, updates coming in after setting work_in_progress
in sugov_update_commit() and clearing it in sugov_work() will still
be dropped due to the work_in_progress check in sugov_update_single().

To close that window, rearrange the code so as to acquire the update
lock around the deferred update branch in sugov_update_single()
and drop the work_in_progress check from it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Juri Lelli <juri.lelli@redhat.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
kernel/sched/cpufreq_schedutil.c