Hi Rafael et. al.,
We had some discussions [1] last week on the PM mailing about
upstreaming the cpufreq governor most widely used on Andoid Mobile
phones and tablets: Interactive governor. People (including Rafael)
mostly agreed that we better get it upstreamed and here is an attempt to
upstream most of it (idle notifiers aren't included in this series).
I picked the latest code spread over 70-80 patches from [2]. The
unmodified code, based over mainline is pushed [4] for reference.
I have updated 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. This version is pushed here [3] for testing.
The Android version of interactive governor also uses idle EXIT
notifiers, but that code isn't part of this series and will be sent
separately later. For people interested in looking at that, those are 3
minor patches on top of this series and are pushed here [5].
I haven't changed the core logic of the governor intentionally, as that
rather requires more in-depth knowledge of the use case for which the
optimizations have been done. So, we should do any such thing later on
with new patches, so that people can find things easily.
I also haven't tried to change the userspace interface as that may have
broken the userspace that already exists and uses this governor.
This has been lightly tested on my Exynos board (dual ARM A15), where
the governor gets inserted/removed multiple times, the sysfs files are
all functional. The frequency gets changed with load, etc.
This series is based of pm/bleeding-edge branch + few patches from
Rafael [6] & [7] and few minor cleanups from me [8].
--
viresh
[1] http://marc.info/?l=linux-pm&m=146301864519072
[2] https://android.googlesource.com/kernel/common remotes/android/android-4.4
[3] git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git cpufreq/interactive
[4] git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git cpufreq/interactive-orig
[5] git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git cpufreq/intearctive-idle-notifier
[6] http://marc.info/?l=linux-kernel&m=146318036229244
[7] http://marc.info/?l=linux-kernel&m=146360498820804
[8] http://marc.info/?l=linux-pm&m=146357434108299
Viresh Kumar (2):
cpufreq: Move gov_attr_* macros to cpufreq.h
cpufreq: Add android's 'interactive' governor
Documentation/cpu-freq/governors.txt | 86 ++
drivers/cpufreq/Kconfig | 27 +
drivers/cpufreq/Makefile | 1 +
drivers/cpufreq/cpufreq_governor.h | 8 -
drivers/cpufreq/cpufreq_interactive.c | 1371 ++++++++++++++++++++++++++++
include/linux/cpufreq.h | 12 +
include/trace/events/cpufreq_interactive.h | 112 +++
kernel/sched/cpufreq_schedutil.c | 8 +-
8 files changed, 1613 insertions(+), 12 deletions(-)
create mode 100644 drivers/cpufreq/cpufreq_interactive.c
create mode 100644 include/trace/events/cpufreq_interactive.h
--
2.7.1.410.g6faf27b
Tree/Branch: next-20160701
Git describe: next-20160701
Commit: d936b5e461 Add linux-next specific files for 20160701
Build Time: 75 min 3 sec
Passed: 7 / 9 ( 77.78 %)
Failed: 2 / 9 ( 22.22 %)
Errors: 2
Warnings: 5
Section Mismatches: 0
Failed defconfigs:
arm64-allmodconfig
arm-allmodconfig
Errors:
arm-allmodconfig
../drivers/net/ethernet/mediatek/mtk_eth_soc.c:1300:2: error: implicit declaration of function 'mtk_handle_irq' [-Werror=implicit-function-declaration]
../drivers/net/ethernet/mediatek/mtk_eth_soc.c:1300:25: error: subscripted value is neither array nor pointer nor vector
-------------------------------------------------------------------------------
defconfigs with issues (other than build errors):
2 warnings 0 mismatches : arm64-allmodconfig
1 warnings 0 mismatches : arm-multi_v7_defconfig
4 warnings 0 mismatches : arm-allmodconfig
1 warnings 0 mismatches : arm-multi_v5_defconfig
1 warnings 0 mismatches : arm64-defconfig
-------------------------------------------------------------------------------
Errors summary: 2
1 ../drivers/net/ethernet/mediatek/mtk_eth_soc.c:1300:2: error: implicit declaration of function 'mtk_handle_irq' [-Werror=implicit-function-declaration]
1 ../drivers/net/ethernet/mediatek/mtk_eth_soc.c:1300:25: error: subscripted value is neither array nor pointer nor vector
Warnings Summary: 5
5 ../drivers/usb/host/xhci-ring.c:753:4: warning: 'ep_ring' may be used uninitialized in this function [-Wmaybe-uninitialized]
1 ../include/linux/kernel.h:743:17: warning: comparison of distinct pointer types lacks a cast
1 ../drivers/tty/serial/8250/8250_fintek.c:34:0: warning: "IRQ_MODE" redefined
1 ../arch/arm/mach-s3c64xx/common.h:28:2: warning: its scope is only this definition or declaration, which is probably not what you want
1 ../arch/arm/mach-s3c64xx/common.h:28:2: warning: 'struct device_node' declared inside parameter list
===============================================================================
Detailed per-defconfig build reports below:
-------------------------------------------------------------------------------
arm64-allmodconfig : FAIL, 0 errors, 2 warnings, 0 section mismatches
Warnings:
../include/linux/kernel.h:743:17: warning: comparison of distinct pointer types lacks a cast
../drivers/usb/host/xhci-ring.c:753:4: warning: 'ep_ring' may be used uninitialized in this function [-Wmaybe-uninitialized]
-------------------------------------------------------------------------------
arm-multi_v7_defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
../drivers/usb/host/xhci-ring.c:753:4: warning: 'ep_ring' may be used uninitialized in this function [-Wmaybe-uninitialized]
-------------------------------------------------------------------------------
arm-allmodconfig : FAIL, 2 errors, 4 warnings, 0 section mismatches
Errors:
../drivers/net/ethernet/mediatek/mtk_eth_soc.c:1300:2: error: implicit declaration of function 'mtk_handle_irq' [-Werror=implicit-function-declaration]
../drivers/net/ethernet/mediatek/mtk_eth_soc.c:1300:25: error: subscripted value is neither array nor pointer nor vector
Warnings:
../arch/arm/mach-s3c64xx/common.h:28:2: warning: 'struct device_node' declared inside parameter list
../arch/arm/mach-s3c64xx/common.h:28:2: warning: its scope is only this definition or declaration, which is probably not what you want
../drivers/tty/serial/8250/8250_fintek.c:34:0: warning: "IRQ_MODE" redefined
../drivers/usb/host/xhci-ring.c:753:4: warning: 'ep_ring' may be used uninitialized in this function [-Wmaybe-uninitialized]
-------------------------------------------------------------------------------
arm-multi_v5_defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
../drivers/usb/host/xhci-ring.c:753:4: warning: 'ep_ring' may be used uninitialized in this function [-Wmaybe-uninitialized]
-------------------------------------------------------------------------------
arm64-defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
../drivers/usb/host/xhci-ring.c:753:4: warning: 'ep_ring' may be used uninitialized in this function [-Wmaybe-uninitialized]
-------------------------------------------------------------------------------
Passed with no errors, warnings or mismatches:
x86_64-allnoconfig
arm64-allnoconfig
arm-allnoconfig
x86_64-defconfig