]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cpuidle: Get typical recent sleep interval
authorYouquan Song <youquan.song@intel.com>
Fri, 26 Oct 2012 10:27:07 +0000 (12:27 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 26 Oct 2012 10:27:07 +0000 (12:27 +0200)
commitaa0d559a3ecc4601843ba0b9ba0c61b32888b3d8
tree4b03f926497c7d6f7665a34a898ce3cf42ae5a09
parent778c045c72d9f03f8efdc912afdcb31fbc2ce658
cpuidle: Get typical recent sleep interval

The function detect_repeating_patterns was not very useful for
workloads with alternating long and short pauses, for example
virtual machines handling network requests for each other (say
a web and database server).

Instead, try to find a recent sleep interval that is somewhere
between the median and the mode sleep time, by discarding outliers
to the up side and recalculating the average and standard deviation
until that is no longer required.

This should do something sane with a sleep interval series like:

200 180 210 10000 30 1000 170 200

The current code would simply discard such a series, while the
new code will guess a typical sleep interval just shy of 200.

The original patch come from Rik van Riel <riel@redhat.com>.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Youquan Song <youquan.song@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpuidle/governors/menu.c