]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
cpuidle: menu: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID
authorLen Brown <len.brown@intel.com>
Tue, 16 Dec 2014 06:52:06 +0000 (01:52 -0500)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 17 Dec 2014 01:26:28 +0000 (02:26 +0100)
commit4108b3d96273784f697dd6d8e59ef9203a10a02d
tree38e187ed6a4b853c43b601fde3bbc0d42962c902
parent0c570c183ace73f06e42d65432bf938fbdde6524
cpuidle: menu: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID

When menu sees CPUIDLE_FLAG_TIME_INVALID, it ignores its timestamps,
and assumes that idle lasted as long as the time till next predicted
timer expiration.

But if an interrupt was seen and serviced before that duration,
it would actually be more accurate to use the measured time
rather than rounding up to the next predicted timer expiration.

And if an interrupt is seen and serviced such that the mesured time
exceeds the time till next predicted timer expiration, then
truncating to that expiration is the right thing to do --
since we can never stay idle past that timer expiration.

So the code can do a better job without
checking for CPUIDLE_FLAG_TIME_INVALID.

Signed-off-by: Len Brown <len.brown@intel.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/governors/menu.c