]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ENGR00273073-2 cpufreq: add interactive governor for cpufreq
authorAnson Huang <b20788@freescale.com>
Tue, 30 Jul 2013 18:29:26 +0000 (14:29 -0400)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:07 +0000 (10:06 +0200)
commit37fd63f01dc47be887d83d951fa24153b3814b4f
tree955320b2f601073b72be0e0c819fc6f7ebf857cd
parent57ecc7c1179a41609519a43eed36bff416c47f06
ENGR00273073-2 cpufreq: add interactive governor for cpufreq

cpufreq: interactive: New 'interactive' governor

This governor is designed for latency-sensitive workloads, such as
interactive user interfaces.  The interactive governor aims to be
significantly more responsive to ramp CPU quickly up when CPU-intensive
activity begins.

Existing governors sample CPU load at a particular rate, typically
every X ms.  This can lead to under-powering UI threads for the period of
time during which the user begins interacting with a previously-idle system
until the next sample period happens.

The 'interactive' governor uses a different approach. Instead of sampling
the CPU at a specified rate, the governor will check whether to scale the
CPU frequency up soon after coming out of idle.  When the CPU comes out of
idle, a timer is configured to fire within 1-2 ticks.  If the CPU is very
busy from exiting idle to when the timer fires then we assume the CPU is
underpowered and ramp to MAX speed.

If the CPU was not sufficiently busy to immediately ramp to MAX speed, then
the governor evaluates the CPU load since the last speed adjustment,
choosing the highest value between that longer-term load or the short-term
load since idle exit to determine the CPU speed to ramp to.

A realtime thread is used for scaling up, giving the remaining tasks the
CPU performance benefit, unlike existing governors which are more likely to
schedule rampup work to occur after your performance starved tasks have
completed.

The tuneables for this governor are:
/sys/devices/system/cpu/cpufreq/interactive/min_sample_time:
    The minimum amount of time to spend at the current frequency before
    ramping down. This is to ensure that the governor has seen enough
    historic CPU load data to determine the appropriate workload.
/sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load
    The CPU load at which to ramp to max speed.

Signed-off-by: Mike Chan <mike at android.com>
Signed-off-by: Todd Poynor <toddpoynor at google.com>
Signed-off-by: Allen Martin <amartin at nvidia.com> (submitted improvements)
Signed-off-by: Axel Haslam <axelhaslam at ti.com> (submitted improvements)
Signed-off-by: Anton Vorontsov <anton.vorontsov at linaro.org>
Signed-off-by: Anson Huang <b20788@freescale.com>
drivers/cpufreq/Kconfig
drivers/cpufreq/Makefile
drivers/cpufreq/cpufreq_interactive.c [new file with mode: 0644]
include/linux/cpufreq.h