]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: schedutil: Don't skip freq update when limits change
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 7 Aug 2019 07:06:01 +0000 (12:36 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 10 Aug 2019 11:53:19 +0000 (13:53 +0200)
commitc0225fd510d687c6be45007b229ce0a7b7024da4
treebe9a9feaed5dc12e706866c1de69f2811c091d40
parentd1eb5e4bc966f717b7b0b58d9fc873f3c8e03feb
cpufreq: schedutil: Don't skip freq update when limits change

To avoid reducing the frequency of a CPU prematurely, we skip reducing
the frequency if the CPU had been busy recently.

This should not be done when the limits of the policy are changed, for
example due to thermal throttling. We should always get the frequency
within the new limits as soon as possible.

Trying to fix this by using only one flag, i.e. need_freq_update, can
lead to a race condition where the flag gets cleared without forcing us
to change the frequency at least once. And so this patch introduces
another flag to avoid that race condition.

Fixes: db57e72be450 ("cpufreq: schedutil: Don't set next_freq to UINT_MAX")
Cc: v4.18+ <stable@vger.kernel.org> # v4.18+
Reported-by: Doug Smythies <dsmythies@telus.net>
Tested-by: Doug Smythies <dsmythies@telus.net>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/sched/cpufreq_schedutil.c