Hi all,
This patch set tries to introduce a mechanism for managing power in a way which is closer to the scheduler. This is a draft of some reaserch work which I am going to continue so it is a RFC. I will continue this research in the future.
It is based heavily on IPA (PID approach). It also uses design from schedutil. It also uses mechanims for injecting idle. It should be changed to cfs bandwith controller, though.
Regards, Lukasz Luba
Lukasz Luba (43): thermal: add interface for changing 'weight' of cpu cooling thermal: add sched driven feature to thermal_instance sched/power: add power and thermal governance thermal: add function which triggers update of all zones sched/power: update thermal subsystem after CPUs reweight DT: arm64: exynos5433: Add SoC thermal zone for IPA thermal: add containers with thermal zones DT: arm64: exynos: add support fot container thermal zone thermal: add virtual temperature sensor DT: arm64: exynos: add capacitance for every cpu core DT: arm64: exynos: Change polling time for soc thermal zone sched/power: change update filter function idle_inject: move needed structure to header file thermal: cpu_cooling: add function showing CPUs in cooling dev sched/power: add idle injection sched/sched.h: add new function for changing cluster power 'weight' sched/fair: testing sched power interfaces sched/power: change 'weight' type allowing to decrese value sched/power: refactor update function sched: power: add thermal governor and move some headers thermal: cpu_cooling: add function which copies cpumask sched/power: add thermal governor cooling devices and zones sched/power: register only the real cooling device not instances sched/power: cleanup warnings sched/power: change calc budget params thermal: add trip flag for control algorithm sched/power: add support of trip control algorithm arm64: dts: exynos5433: add ctrl-alg flag in trip points sched/power: allocate power for cooling devices sched/power: implement simple PI with integral decaying arm64: dts: exynos5433: change the trip points to passive sched/power: alwas take into current integral into account arm64: dts: exynos5433: change virtual temperature sensor sched/power: handle cluster weight change requests sched/power: set sum_power to 1 and finish calculation arm64: dts: exynos5433: change trip point 'SoC' thresholds sched: fix flags in sched_power sched/power: improve share power algorithm sched/power: collect unused power for future split sched/power: add check for max possible frequency of cooling device sched/power: max allowed state capping fixed sched/power: add recalc power budget and trace events sched/power: do not change state for single cooling zone
.../dts/exynos/exynos5433-tm2-common.dtsi | 4 + .../arm64/boot/dts/exynos/exynos5433-tmu.dtsi | 120 +- arch/arm64/boot/dts/exynos/exynos5433.dtsi | 14 + drivers/powercap/idle_inject.c | 15 +- drivers/thermal/Kconfig | 5 + drivers/thermal/Makefile | 2 + drivers/thermal/cpu_cooling.c | 35 + drivers/thermal/fair_share.c | 3 +- drivers/thermal/gov_bang_bang.c | 2 +- drivers/thermal/hisi_thermal.c | 3 +- drivers/thermal/of-thermal.c | 129 +- drivers/thermal/power_allocator.c | 3 +- drivers/thermal/qoriq_thermal.c | 3 +- drivers/thermal/rcar_gen3_thermal.c | 3 +- drivers/thermal/samsung/exynos_tmu.c | 3 +- drivers/thermal/step_wise.c | 3 +- drivers/thermal/tegra/soctherm.c | 2 +- drivers/thermal/thermal_core.c | 91 +- drivers/thermal/thermal_helpers.c | 3 +- drivers/thermal/thermal_sysfs.c | 3 +- drivers/thermal/uniphier_thermal.c | 3 +- drivers/thermal/user_space.c | 3 +- drivers/thermal/virt_tsens.c | 126 ++ include/linux/cpu_cooling.h | 25 + include/linux/idle_inject.h | 39 +- include/linux/sched/power.h | 15 + include/linux/thermal.h | 17 + .../thermal => include/linux}/thermal_core.h | 10 + include/trace/events/sched_power.h | 60 + kernel/sched/Makefile | 2 +- kernel/sched/fair.c | 13 + kernel/sched/power.c | 1128 +++++++++++++++++ kernel/sched/power.h | 115 ++ kernel/sched/sched.h | 37 + 34 files changed, 1950 insertions(+), 89 deletions(-) create mode 100644 drivers/thermal/virt_tsens.c create mode 100644 include/linux/sched/power.h rename {drivers/thermal => include/linux}/thermal_core.h (93%) create mode 100644 include/trace/events/sched_power.h create mode 100644 kernel/sched/power.c create mode 100644 kernel/sched/power.h