OSDN Git Service

UPSTREAM: cpufreq: schedutil: Refactor sugov_next_freq_shared()
authorChris Redpath <chris.redpath@arm.com>
Thu, 25 May 2017 14:22:59 +0000 (15:22 +0100)
committerAndres Oportus <andresoportus@google.com>
Tue, 18 Jul 2017 18:18:40 +0000 (18:18 +0000)
commita8a200d83b1ff334a6c607b8fda848551648689b
treec0b88feb76a1c64385de0300c97dcfaa8c13f62a
parent7378c38a80fc434f8d6cf61167d843ca388468b5
UPSTREAM: cpufreq: schedutil: Refactor sugov_next_freq_shared()

The loop in sugov_next_freq_shared() contains an if block to skip the
loop for the current CPU. This turns out to be an unnecessary
conditional in the scheduler's hot-path for every CPU in the policy.

It would be better to drop the conditional and make the loop treat all
the CPUs in the same way. That would eliminate the need of calling
sugov_iowait_boost() at the top of the routine.

To keep the code optimized to return early if the current CPU has RT/DL
flags set, move the flags check to sugov_update_shared() instead in
order to avoid the function call entirely.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit cba1dfb57b94c234728b689d9b00d4267fa1a879)
(modified for SCHED_CPUFREQ_DL vs SCHED_CPUFREQ_RT)
Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Change-Id: Ie046fdc8eda46821356750edd0fb6f7d077af363
kernel/sched/cpufreq_schedutil.c