cpufreq: schedutil: Call sugov_update_next_freq() before check to fast_switch_enabled
authorYue Hu <huyue2@yulong.com>
Wed, 24 Feb 2021 06:39:27 +0000 (14:39 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 18 Mar 2021 18:49:16 +0000 (19:49 +0100)
commit389e4ecf5fec9464320971ec707893ccec5a04d1
tree0a68af3d0a037753f9f806a3060bcf5bb7e7a3af
parent1e28eed17697bcf343c6743f0028cc3b5dd88bf0
cpufreq: schedutil: Call sugov_update_next_freq() before check to fast_switch_enabled

Note that sugov_update_next_freq() may return false, that means the
caller sugov_fast_switch() will do nothing except fast switch check.

Similarly, sugov_deferred_update() also has unnecessary operations
of raw_spin_{lock,unlock} in sugov_update_single_freq() for that case.

So, let's call sugov_update_next_freq() before the fast switch check
to avoid unnecessary behaviors above. Accordingly, update interface
definition to sugov_deferred_update() and remove sugov_fast_switch()
since we will call cpufreq_driver_fast_switch() directly instead.

Signed-off-by: Yue Hu <huyue2@yulong.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/sched/cpufreq_schedutil.c