UPSTREAM: cpufreq: schedutil: Make iowait boost more energy efficient
authorJoel Fernandes <joelaf@google.com>
Mon, 28 Aug 2017 16:56:27 +0000 (09:56 -0700)
committerJoel Fernandes <joelaf@google.com>
Thu, 31 Aug 2017 12:43:42 +0000 (12:43 +0000)
commit1ed33cf95476666656d510fab15d87ee04e2327d
treeee32500aa811c2bc0001481d4efd425f1d914224
parent610af855d9a55fdccef35003fe9f007afa0332d7
UPSTREAM: cpufreq: schedutil: Make iowait boost more energy efficient

Currently the iowait_boost feature in schedutil makes the frequency go
to max on iowait wakeups.  This feature was added to handle a case that
Peter described where the throughput of operations involving continuous
I/O requests [1] is reduced due to running at a lower frequency, however
the lower throughput itself causes utilization to be low and hence
causing frequency to be low hence its "stuck".

Instead of going to max, its also possible to achieve the same effect by
ramping up to max if there are repeated in_iowait wakeups happening.
This patch is an attempt to do that. We start from a lower frequency
(policy->min) and double the boost for every consecutive iowait update
until we reach the maximum iowait boost frequency (iowait_boost_max).

I ran a synthetic test (continuous O_DIRECT writes in a loop) on an x86
machine with intel_pstate in passive mode using schedutil. In this test
the iowait_boost value ramped from 800MHz to 4GHz in 60ms. The patch
achieves the desired improved throughput as the existing behavior.

[1] https://patchwork.kernel.org/patch/9735885/

Change-Id: I4a018434a50f4ca29ec15b03465f6dc212e54423
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Suggested-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Joel Fernandes <joelaf@google.com>
kernel/sched/cpufreq_schedutil.c