linux/Documentation
Viresh Kumar 9d53afdb56 RFC: FROMLIST: cpufreq: Add android's 'interactive' governor
https://lkml.org/lkml/2016/9/14/208

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.

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>

Change-Id: Ib5e8d1dab0fa3cc5ba79b7a554c8dde35435cbdb
[AmitP: Cherry-picked this version from
        https://git.kernel.org/cgit/linux/kernel/git/vireshk/pm.git/log/?h=cpufreq/interactive-idle-notifier.
        Also refactored and folded https://lkml.org/lkml/2016/9/14/209
        patch into this unified patch.]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Liang Chen <cl@rock-chips.com>
(cherry picked from https://android.googlesource.com/kernel/msm
 commit 33f7a05d4e82c81841af20e6a944a4c3f9b2973e)
2022-07-27 15:02:09 +08:00
..
ABI Merge tag 'ASB-2022-06-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:58:38 +08:00
accounting psi: Fix uaf issue when psi trigger is destroyed while being polled 2022-02-05 12:37:55 +01:00
admin-guide RFC: FROMLIST: cpufreq: Add android's 'interactive' governor 2022-07-27 15:02:09 +08:00
arm ARM: 9012/1: move device tree mapping out of linear region 2021-05-19 10:13:18 +02:00
arm64 Merge 56cf5326bd ("arm64: entry: Add macro for reading symbol addresses from the trampoline") into android12-5.10-lts 2022-03-16 15:01:36 +01:00
block rk: revert to v4.19 2021-03-17 18:05:39 +08:00
bpf bpf: Migrate from patchwork.ozlabs.org to patchwork.kernel.org. 2020-10-11 22:05:47 +02:00
cdrom
core-api swiotlb: fix info leak with DMA_FROM_DEVICE 2022-04-08 14:39:46 +02:00
cpu-freq
crypto UPSTREAM: crypto: remove cipher routines from public crypto API 2021-05-13 07:53:31 +00:00
dev-tools UPSTREAM: ubsan: remove UBSAN_MISC in favor of individual options 2021-10-21 08:33:13 -07:00
device-mapper rk: revert to v4.19 2021-03-17 18:05:39 +08:00
devicetree dt-bindings: media: i2c: Document add lt7911uxc 2022-07-19 18:41:41 +08:00
doc-guide docs: kerneldoc.py: add support for kerneldoc -nosymbol 2020-10-15 07:49:38 +02:00
driver-api Documentation: fix firewire.rst ABI file path error 2022-01-27 10:54:29 +01:00
fault-injection lkdtm: replace SCSI_DISPATCH_CMD with SCSI_QUEUE_RQ 2021-09-15 09:50:42 +02:00
fb drm fixes (round two) for 5.10-rc1 2020-10-23 13:56:34 -07:00
features s390 updates for the 5.10 merge window 2020-10-16 12:36:38 -07:00
filesystems ANDROID: Incremental-fs: Doc: correct a sysfs path in incfs.rst 2022-01-26 08:57:08 +00:00
firmware_class
firmware-guide Documentation: ACPI: Fix data node reference documentation 2022-01-27 10:54:29 +01:00
fpga
gpu Revert "fbcon: Disable accelerated scrolling" 2022-02-08 18:30:40 +01:00
hid rk: revert to v4.19 2021-03-17 18:05:39 +08:00
hwmon hwmon: (lm90) Add basic support for TI TMP461 2021-12-29 12:25:59 +01:00
i2c rk: revert to v4.19 2021-03-17 18:05:39 +08:00
ia64
ide
iio
infiniband
input
isdn
kbuild FROMLIST: kbuild: Add environment variables for userprogs flags 2022-05-10 16:09:36 +00:00
kernel-hacking
leds docs: leds: index.rst: add a missing file 2020-11-02 13:45:37 +01:00
litmus-tests
livepatch
locking Documentation/locking/locktypes: Update migrate_disable() bits. 2021-12-14 11:32:42 +01:00
m68k
maintainer
mhi
mips dt: Remove booting-without-of.rst 2020-10-13 13:33:16 -05:00
misc-devices Documentation: remove mic/index from misc-devices/index.rst 2020-11-04 11:38:32 +01:00
netlabel
networking This is the 5.10.89 stable release 2021-12-29 14:17:18 +01:00
nios2
nvdimm
openrisc
parisc
PCI Documentation: better locations for sysfs-pci, sysfs-tagging 2020-10-09 09:33:23 -06:00
pcmcia
power rk: revert to v4.19 2021-03-17 18:05:39 +08:00
powerpc powerpc/64s/syscall: Use pt_regs.trap to distinguish syscall ABI difference between sc and scv syscalls 2021-05-26 12:06:53 +02:00
process Documentation: update stable tree link 2022-04-08 14:39:50 +02:00
RCU Merge branch 'for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into core/rcu 2020-10-09 08:21:56 +02:00
riscv
s390
scheduler rk: revert to v4.19 2021-03-17 18:05:39 +08:00
scsi scsi: libsas: Introduce a _gfp() variant of event notifiers 2021-03-25 09:04:11 +01:00
security watch_queue: Drop references to /dev/watch_queue 2021-03-04 11:37:59 +01:00
sh dt: Remove booting-without-of.rst 2020-10-13 13:33:16 -05:00
sound Merge tag 'ASB-2022-06-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:58:38 +08:00
sparc
sphinx tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
sphinx-static
spi
staging
target tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
timers
trace This is the 5.10.104 stable release 2022-03-12 13:57:09 +01:00
translations net: switch to the kernel.org patchwork instance 2020-11-11 17:12:00 -08:00
usb Merge tag 'ASB-2022-06-05_12-5.10' of https://android.googlesource.com/kernel/common 2022-07-15 17:58:38 +08:00
userspace-api This is the 5.10.50 stable release 2021-07-14 17:35:23 +02:00
virt This is the 5.10.44 stable release 2021-06-16 13:14:03 +02:00
vm This is the 5.10.50 stable release 2021-07-14 17:35:23 +02:00
w1 docs: w1: w1_therm: Fix broken xref, mistakes, clarify text 2020-10-08 09:47:15 +02:00
watchdog
x86 rk: revert to v4.19 2021-03-17 18:05:39 +08:00
xtensa xtensa: fix TLBTEMP area placement 2020-11-16 02:13:15 -08:00
.gitignore
asm-annotations.rst x86/entry: Emit a symbol for register restoring thunk 2021-02-03 23:28:40 +01:00
atomic_bitops.txt
atomic_t.txt rk: revert to v4.19 2021-03-17 18:05:39 +08:00
Changes
CodingStyle
conf.py rk: revert to v4.19 2021-03-17 18:05:39 +08:00
COPYING-logo
dma-buf-test-exporter.txt MALI: rockchip: upgrade bifrost DDK to g7p1-01bet0, from g6p0-01eac0 2021-10-29 18:44:22 +08:00
docutils.conf
dontdiff kbuild: generate Module.symvers only when vmlinux exists 2021-05-19 10:12:59 +02:00
index.rst rk: revert to v4.19 2021-03-17 18:05:39 +08:00
Kconfig docs: Kconfig/Makefile: add a check for broken ABI files 2020-10-30 13:08:07 +01:00
logo.gif
Makefile A small number of fixes, plus a build tweak to respect the desire for 2020-11-03 09:57:30 -08:00
memory-barriers.txt
SubmittingPatches
watch_queue.rst