]> git.karo-electronics.de Git - linux-beck.git/commitdiff
cpuidle: Ignore interval prediction result when timer is shorter
authorTuukka Tikkanen <tuukka.tikkanen@linaro.org>
Wed, 14 Aug 2013 16:02:34 +0000 (19:02 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 22 Aug 2013 22:24:15 +0000 (00:24 +0200)
This patch prevents cpuidle menu governor from using repeating interval
prediction result if the idle period predicted is longer than the one
allowed by shortest running timer.

Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/governors/menu.c

index cbbb73b37a6d1d0d99a9d4613633324ef0833219..351697305fe7a25d895bc31d68a68a1232679ad5 100644 (file)
@@ -238,10 +238,13 @@ again:
         *
         * The typical interval is obtained when standard deviation is small
         * or standard deviation is small compared to the average interval.
+        *
+        * Use this result only if there is no timer to wake us up sooner.
         */
        if (((avg > stddev * 6) && (divisor * 4 >= INTERVALS * 3))
                                                        || stddev <= 20) {
-               data->predicted_us = avg;
+               if (data->expected_us > avg)
+                       data->predicted_us = avg;
                return;
 
        } else if ((divisor * 4) > INTERVALS * 3) {