linux-stable/drivers/cpuidle
Len Brown b73026b9c9 cpuidle: ladder: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID
When the ladder governor sees the CPUIDLE_FLAG_TIME_INVALID flag,
it unconditionally causes a state promotion by setting last_residency
to a number higher than the state's promotion_time:

last_residency = last_state->threshold.promotion_time + 1

It does this for fear that cpuidle_get_last_residency()
will be in-accurate, because cpuidle_enter_state() invoked
a state with CPUIDLE_FLAG_TIME_INVALID.

But the only state with CPUIDLE_FLAG_TIME_INVALID is
acpi_safe_halt(), which may return well after its actual
idle duration because it enables interrupts, so cpuidle_enter_state()
also measures interrupt service time.

So what?  In ladder, a huge invalid last_residency has exactly
the same effect as the current code -- it unconditionally
causes a state promotion.

In the case where the idle residency plus measured interrupt
handling time is less than the state's demotion_time -- we should
use that timestamp to give ladder a chance to demote, rather than
unconditionally promoting.

This can be done by simply ignoring the CPUIDLE_FLAG_TIME_INVALID,
and using the "invalid" time, as it is either equal to what we are
doing today, or better.

Signed-off-by: Len Brown <len.brown@intel.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-12-17 02:26:28 +01:00
..
governors cpuidle: ladder: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID 2014-12-17 02:26:28 +01:00
coupled.c arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00
cpuidle-arm64.c Merge back earlier cpuidle material for 3.19-rc1. 2014-11-21 16:31:42 +01:00
cpuidle-at91.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
cpuidle-big_little.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
cpuidle-calxeda.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
cpuidle-clps711x.c ARM: clps711x: Add cpuidle driver 2014-04-30 01:33:02 +02:00
cpuidle-cps.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
cpuidle-exynos.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
cpuidle-kirkwood.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
cpuidle-mvebu-v7.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
cpuidle-powernv.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
cpuidle-pseries.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
cpuidle-ux500.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
cpuidle-zynq.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
cpuidle.c sched: Let the scheduler see CPU idle states 2014-09-24 14:46:58 +02:00
cpuidle.h cpuidle: support multiple drivers 2012-11-15 00:34:23 +01:00
driver.c cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic 2014-11-12 21:17:27 +01:00
dt_idle_states.c Merge back earlier cpuidle material for 3.19-rc1. 2014-11-21 16:31:42 +01:00
dt_idle_states.h drivers: cpuidle: implement DT based idle states infrastructure 2014-09-25 10:52:20 +02:00
governor.c cpuidle: Replace strnicmp with strncasecmp 2014-09-25 01:17:10 +02:00
Kconfig drivers: cpuidle: CPU idle ARM64 driver 2014-09-25 10:52:21 +02:00
Kconfig.arm ACPI and power management updates for 3.18-rc1 2014-10-09 16:07:43 -04:00
Kconfig.arm64 drivers: cpuidle: CPU idle ARM64 driver 2014-09-25 10:52:21 +02:00
Kconfig.mips MIPS: Kconfig: Add missing MIPS_CPS dependencies to PM and cpuidle 2014-10-23 19:58:05 +02:00
Kconfig.powerpc powerpc/powernv/cpuidle: Back-end cpuidle driver for powernv platform. 2014-01-29 17:02:24 +11:00
Makefile drivers: cpuidle: CPU idle ARM64 driver 2014-09-25 10:52:21 +02:00
sysfs.c cpuidle: fix permission for driver name sysfs node 2014-07-19 21:43:28 +02:00