1
0
Fork 0
remarkable-linux/Documentation/cpu-freq
Viresh Kumar 2b62659582 cpufreq: Add android's 'interactive' governor
Interactive governor has lived in Android sources for a very long time
and this commit is based on the code present in following branch:

https://android.googlesource.com/kernel/common android-4.4

The Interactive governor is designed for latency-sensitive workloads,
such as interactive user interfaces like the mobile phones and tablets.
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 and then update the frequency from a work-handler.  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.

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

The Android version of interactive governor also checks whether to scale
the CPU frequency up soon after coming out of idle.  When the CPU comes
out of idle, the governor check if the CPU sampling is overdue or not.
If yes, it immediately starts the sampling.  Otherwise, the utilization
hooks from the scheduler handle the sampling later.  If the CPU is very
busy from exiting idle to when the evaluation happens, then it assumes
that the CPU is under-powered and ramps it 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.

Idle notifiers will be be handled later and are not included for now.

The core of this code is written and maintained (in Android
repositories) by Mike Chan and Todd Poyner over a long period of time.

Vireshk has made changes to to the governor to align it with the current
practices followed with mainline governors, like using utilization hooks
from the scheduler and handling kobject (for governor's sysfs directory)
in a race free manner. And of course this included general cleanup of
the governor as well.

Signed-off-by: Mike Chan <mike@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

---
V1->V2:
- Changes to fix compilation issues with updated mainline
- Timer APIs got updated
 - s/mod_timer_pinned/mod_timer
 - s/init_timer/init_timer_pinned
- Updated prototypes of cpufreq_frequency_table_target() and
  update_util_handler()
2017-02-23 14:21:42 +02:00
..
amd-powernow.txt Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
boost.txt Documentation: cpufreq / boost: Update BOOST documentation 2014-01-17 02:00:45 +01:00
core.txt cpufreq: Unexport cpufreq_frequency_table_cpuinfo() 2016-06-02 23:24:41 +02:00
cpu-drivers.txt cpufreq: Return index from cpufreq_frequency_table_target() 2016-06-09 00:58:06 +02:00
cpufreq-nforce2.txt Fix typos in /Documentation : Misc 2006-11-30 05:21:10 +01:00
cpufreq-stats.txt cpufreq-stats: Minor documentation fix 2016-09-08 23:05:07 +02:00
governors.txt cpufreq: Add android's 'interactive' governor 2017-02-23 14:21:42 +02:00
index.txt cpufreq: Make linux-pm@vger.kernel.org official mailing list 2014-05-01 01:15:32 +02:00
intel-pstate.txt Documentation: cpufreq: intel_pstate: fix typo 2016-02-18 20:31:53 +01:00
pcc-cpufreq.txt Revert "cpufreq: pcc-cpufreq: update default value of cpuinfo_transition_latency" 2016-07-22 23:51:06 +02:00
user-guide.txt Documentation: cpufreq: delete duplicate description of sysfs interface 'scaling_driver' 2015-05-05 23:23:25 +02:00