cpuidle: Menu governor fix wrong usage of measured_us
authorvenkatesh.pallipadi@intel.com <venkatesh.pallipadi@intel.com>
Thu, 31 Jul 2008 02:21:43 +0000 (19:21 -0700)
committerAndi Kleen <ak@linux.intel.com>
Fri, 15 Aug 2008 19:25:25 +0000 (21:25 +0200)
commit320eee776357db52d6fcfb11cff985b1976a4595
tree29859b2e6209a35fc6a735fa4c195e7daeaa1b31
parenta2bd92023357e47f22a34d4cb1635453546662bc
cpuidle: Menu governor fix wrong usage of measured_us

There is a bug in menu governor where we have
if (data->elapsed_us < data->elapsed_us + measured_us)

with measured_us already having elapsed_us added in tickless case here
unsigned int measured_us =
cpuidle_get_last_residency(dev) + data->elapsed_us;

Also, it should be last_residency, not measured_us, that need to be used to
do comparing and distinguish between expected & non-expected events.

Refactor menu_reflect() to fix these two problems.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/cpuidle/governors/menu.c