Skip to content

Commit

Permalink
cpuidle: Ignore interval prediction result when timer is shorter
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tuukka Tikkanen authored and rafaeljw committed Aug 22, 2013
1 parent 81455e7 commit 330647a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/cpuidle/governors/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,13 @@ static void get_typical_interval(struct menu_device *data)
*
* 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) {
Expand Down

0 comments on commit 330647a

Please sign in to comment.