linux/drivers/cpuidle
Rafael J. Wysocki e43dcf2021 cpuidle: teo: Consider hits and misses metrics of disabled states
The TEO governor uses idle duration "bins" defined in accordance with
the CPU idle states table provided by the driver, so that each "bin"
covers the idle duration range between the target residency of the
idle state corresponding to it and the target residency of the closest
deeper idle state.  The governor collects statistics for each bin
regardless of whether or not the idle state corresponding to it is
currently enabled.

In particular, the "hits" and "misses" metrics measure the likelihood
of a situation in which both the time till the next timer (sleep
length) and the idle duration measured after wakeup fall into the
given bin.  Namely, if the "hits" value is greater than the "misses"
one, that situation is more likely than the one in which the sleep
length falls into the given bin, but the idle duration measured after
wakeup falls into a bin corresponding to one of the shallower idle
states.

If the idle state corresponding to the given bin is disabled, it
cannot be selected and if it turns out to be the one that should be
selected, a shallower idle state needs to be used instead of it.
Nevertheless, the metrics collected for the bin corresponding to it
are still valid and need to be taken into account as though that
state had not been disabled.

For this reason, make teo_select() always use the "hits" and "misses"
values of the idle duration range that the sleep length falls into
even if the specific idle state corresponding to it is disabled and
if the "hits" values is greater than the "misses" one, select the
closest enabled shallower idle state in that case.

Fixes: b26bf6ab71 ("cpuidle: New timer events oriented governor for tickless systems")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: 5.1+ <stable@vger.kernel.org> # 5.1+
2019-10-14 10:40:33 +02:00
..
governors cpuidle: teo: Consider hits and misses metrics of disabled states 2019-10-14 10:40:33 +02:00
coupled.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
cpuidle-arm.c ARM: cpuidle: Remove overzealous error logging 2019-08-09 17:51:39 +01:00
cpuidle-at91.c drivers/cpuidle: Convert non-modular drivers to use builtin_platform_driver 2015-06-16 14:12:38 -04:00
cpuidle-big_little.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cpuidle-calxeda.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
cpuidle-clps711x.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
cpuidle-cps.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
cpuidle-exynos.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cpuidle-haltpoll.c cpuidle-haltpoll: Enable kvm guest polling when dedicated physical CPUs are available 2019-09-11 17:46:15 +02:00
cpuidle-kirkwood.c ARM: cpuidle: Remove duplicate header inclusion 2015-03-23 18:03:11 +01:00
cpuidle-mvebu-v7.c cpuidle: mvebu: disable the bind/unbind attributes and use builtin_platform_driver 2015-10-23 12:40:48 +02:00
cpuidle-powernv.c powernv/cpuidle: Use parsed device tree values for cpuidle_init 2018-07-31 19:56:44 +10:00
cpuidle-psci.c PSCI: cpuidle: Refactor CPU suspend power_state parameter handling 2019-08-09 17:51:39 +01:00
cpuidle-pseries.c powerpc/pseries/cpuidle: Fix preempt warning 2018-12-04 19:45:01 +11:00
cpuidle-ux500.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cpuidle-zynq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
cpuidle.c cpuidle: add poll_limit_ns to cpuidle_device structure 2019-07-30 17:27:37 +02:00
cpuidle.h cpuidle: allow governor switch on cpuidle_register_driver() 2019-09-11 17:36:30 +02:00
driver.c cpuidle: allow governor switch on cpuidle_register_driver() 2019-09-11 17:36:30 +02:00
dt_idle_states.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
dt_idle_states.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
governor.c cpuidle: allow governor switch on cpuidle_register_driver() 2019-09-11 17:36:30 +02:00
Kconfig cpuidle: add haltpoll governor 2019-07-30 17:27:37 +02:00
Kconfig.arm ARM: psci: cpuidle: Enable PSCI CPUidle driver 2019-08-09 17:51:39 +01:00
Kconfig.mips treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig.powerpc treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile Power management updates for 5.4-rc1 2019-09-17 19:15:14 -07:00
poll_state.c cpuidle: add poll_limit_ns to cpuidle_device structure 2019-07-30 17:27:37 +02:00
sysfs.c cpuidle: add poll_limit_ns to cpuidle_device structure 2019-07-30 17:27:37 +02:00