linux/drivers/cpuidle
Shreyas B. Prabhu dbd1b8ea43 cpuidle: Fix last_residency division
Snooze is a poll idle state in powernv and pseries platforms. Snooze
has a timeout so that if a CPU stays in snooze for more than target
residency of the next available idle state, then it would exit
thereby giving chance to the cpuidle governor to re-evaluate and
promote the CPU to a deeper idle state. Therefore whenever snooze
exits due to this timeout, its last_residency will be target_residency
of the next deeper state.

Commit e93e59ce5b "cpuidle: Replace ktime_get() with local_clock()"
changed the math around last_residency calculation. Specifically,
while converting last_residency value from nano- to microseconds, it
carries out right shift by 10. Because of that, in snooze timeout
exit scenarios last_residency calculated is roughly 2.3% less than
target_residency of the next available state. This pattern is picked
up by get_typical_interval() in the menu governor and therefore
expected_interval in menu_select() is frequently less than the
target_residency of any state other than snooze.

Due to this we are entering snooze at a higher rate, thereby
affecting the single thread performance.

Fix this by using more precise division via ktime_us_delta().

Fixes: e93e59ce5b "cpuidle: Replace ktime_get() with local_clock()"
Reported-by: Anton Blanchard <anton@samba.org>
Bisected-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-07-04 14:17:34 +02:00
..
governors cpuidle: menu: Fall back to polling if next timer event is near 2016-03-21 15:50:28 +01:00
Kconfig cpuidle: Don't enable all governors by default 2016-01-15 22:39:58 +01:00
Kconfig.arm
Kconfig.mips
Kconfig.powerpc
Makefile
coupled.c cpuidle: coupled: remove unused define cpuidle_coupled_lock 2016-01-27 23:08:46 +01:00
cpuidle-arm.c ARM: cpuidle: Pass on arm_cpuidle_suspend()'s return value 2016-04-28 15:15:14 +02:00
cpuidle-at91.c
cpuidle-big_little.c
cpuidle-calxeda.c
cpuidle-clps711x.c drivers/cpuidle: make cpuidle-clps711x.c explicitly non-modular 2015-12-15 00:22:21 +01:00
cpuidle-cps.c
cpuidle-exynos.c drivers/cpuidle: make cpuidle-exynos.c explicitly non-modular 2015-12-15 00:22:22 +01:00
cpuidle-kirkwood.c
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 powerpc/powernv: remove FW_FEATURE_OPALv3 and just use FW_FEATURE_OPAL 2015-12-17 22:40:54 +11:00
cpuidle-pseries.c
cpuidle-ux500.c drivers/cpuidle: make cpuidle-ux500.c explicitly non-modular 2015-12-15 00:22:22 +01:00
cpuidle-zynq.c
cpuidle.c cpuidle: Fix last_residency division 2016-07-04 14:17:34 +02:00
cpuidle.h cpuidle/coupled: Add sanity check for safe_state_index 2015-09-03 03:05:47 +02:00
driver.c cpuidle/coupled: Add sanity check for safe_state_index 2015-09-03 03:05:47 +02:00
dt_idle_states.c
dt_idle_states.h
governor.c
sysfs.c