]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cpuidle: Get typical recent sleep interval
authorYouquan Song <youquan.song@intel.com>
Wed, 24 Oct 2012 19:27:05 +0000 (21:27 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 Oct 2012 19:27:05 +0000 (21:27 +0200)
commit20977fe35f666a584b818ad8fa18ef0a2b1cac16
tree841d4dc79c3cab51bdaa8f4ebb21012a3e6d7716
parentafd7ba271a312f7ef42019f14bd851b16591a495
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