diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2016-02-16 19:19:18 (GMT) |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-02-16 23:27:16 (GMT) |
commit | 7024b18ca461bab45e5fb329f6e3d904d5109401 (patch) | |
tree | 2dd0d4bc8479ccf843094e6c584fafb7dd3260ac /fs/xattr.c | |
parent | 18558cae0272f8fd9647e69d3fec1565a7949865 (diff) | |
download | linux-7024b18ca461bab45e5fb329f6e3d904d5109401.tar.xz |
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 'fs/xattr.c')
0 files changed, 0 insertions, 0 deletions