diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2016-02-16 20:19:18 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-02-17 00:27:16 +0100 |
commit | 7024b18ca461bab45e5fb329f6e3d904d5109401 (patch) | |
tree | 2dd0d4bc8479ccf843094e6c584fafb7dd3260ac /drivers/usb/host/sl811-hcd.c | |
parent | Linux 4.5-rc4 (diff) | |
download | linux-7024b18ca461bab45e5fb329f6e3d904d5109401.tar.xz linux-7024b18ca461bab45e5fb329f6e3d904d5109401.zip |
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>
Diffstat (limited to 'drivers/usb/host/sl811-hcd.c')
0 files changed, 0 insertions, 0 deletions