linux-stable/drivers/cpuidle/governors
Rasmus Villemoes 7024b18ca4 cpuidle: menu: avoid expensive square root computation
Computing the integer square root is a rather expensive operation, at
least compared to doing a 64x64 -> 64 multiply (avg*avg) and, on 64
bit platforms, doing an extra comparison to a constant (variance <=
U64_MAX/36).

On 64 bit platforms, this does mean that we add a restriction on the
range of the variance where we end up using the estimate (since
previously the stddev <= ULONG_MAX was a tautology), but on the other
hand, we extend the range quite substantially on 32 bit platforms - in
both cases, we now allow standard deviations up to 715 seconds, which
is for example guaranteed if all observations are less than 1430
seconds.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-02-17 00:27:16 +01:00
..
ladder.c cpuidle: Default to ladder governor on ticking systems 2016-01-15 22:36:19 +01:00
Makefile cpuidle: consolidate 2.6.22 cpuidle branch into one patch 2007-10-10 00:12:41 -04:00
menu.c cpuidle: menu: avoid expensive square root computation 2016-02-17 00:27:16 +01:00