cpufreq: schedutil: restore cached freq when next_f is not changed
authorWei Wang <wvw@google.com>
Fri, 16 Oct 2020 18:17:22 +0000 (11:17 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 19 Oct 2020 15:38:16 +0000 (17:38 +0200)
commit0070ea29623904224c0f5fa279a16a4ac9223295
treeaf556351e9a36f65cc3d558dcabd9b249fd77348
parent5368512abe08a28525d9b24abbfc2a72493e8dba
cpufreq: schedutil: restore cached freq when next_f is not changed

We have the raw cached freq to reduce the chance in calling cpufreq
driver where it could be costly in some arch/SoC.

Currently, the raw cached freq is reset in sugov_update_single() when
it avoids frequency reduction (which is not desirable sometimes), but
it is better to restore the previous value of it in that case,
because it may not change in the next cycle and it is not necessary
to change the CPU frequency then.

Adapted from https://android-review.googlesource.com/1352810/

Signed-off-by: Wei Wang <wvw@google.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
[ rjw: Subject edit and changelog rewrite ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/sched/cpufreq_schedutil.c