Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1335923

Re: [PATCH 1/2] cpuidle: menu: avoid expensive square root computation

From "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] cpuidle: menu: avoid expensive square root computation
Date 2016-02-17 00:30 +0100
Message-ID <r2Xea-6hl-13@gated-at.bofh.it> (permalink)
References <r2Tkf-3E0-25@gated-at.bofh.it>
Organization Intel Technology Poland Sp. z o. o., KRS 101882, ul. Slowackiego 173, 80-298 Gdansk

Show all headers | View raw


On 2/16/2016 8:19 PM, Rasmus Villemoes wrote:
> 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>

Both patches look good to me,  so I'm going to queue them up for 4.6.

If anyone has any issues with that, please let me know.

Thanks,
Rafael

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] cpuidle: menu: avoid expensive square root computation Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2016-02-16 20:20 +0100
  [PATCH 2/2] cpuidle: menu: help gcc generate slightly better code Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2016-02-16 20:30 +0100
  Re: [PATCH 1/2] cpuidle: menu: avoid expensive square root  computation "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> - 2016-02-17 00:30 +0100

csiph-web