cpuidle: Move perf multiplier calculation out of the selection loop
authortuukka.tikkanen@linaro.org <tuukka.tikkanen@linaro.org>
Mon, 24 Feb 2014 06:29:35 +0000 (08:29 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 6 Mar 2014 00:45:59 +0000 (01:45 +0100)
commit96e95182e95fd4e0069ff4d6ee1888fe9031d154
treedfb20bf37e38982972b7fde9a0e7e8729aa3db22
parent61c66d6efa23759f1061d80ced668977fd28337d
cpuidle: Move perf multiplier calculation out of the selection loop

The menu governor performance multiplier defines a minimum predicted
idle duration to latency ratio. Instead of checking this separately
in every iteration of the state selection loop, adjust the overall
latency restriction for the whole loop if this restriction is tighter
than what is set by the QoS subsystem.

The original test
s->exit_latency * multiplier > data->predicted_us
becomes
s->exit_latency > data->predicted_us / multiplier
by dividing both sides of the comparison by "multiplier".

While division is likely to be several times slower than multiplication,
the minor performance hit allows making a generic sleep state selection
function based on (sleep duration, maximum latency) tuple.

Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/governors/menu.c