From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Andi Kleen <andi@firstfloor.org>, Andi Kleen <ak@linux.intel.com>,
Ingo Molnar <mingo@kernel.org>,
akpm@linux-foundation.org, lenb@kernel.org,
Eric Dumazet <eric.dumazet@gmail.com>,
Fengguang Wu <fengguang.wu@intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] cpuidle: menu: avoid expensive square root computation
Date: Wed, 17 Feb 2016 00:20:18 +0100 [thread overview]
Message-ID: <56C3AEB2.4000007@intel.com> (raw)
In-Reply-To: <1455650361-26596-1-git-send-email-linux@rasmusvillemoes.dk>
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
prev parent reply other threads:[~2016-02-16 23:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 19:19 [PATCH 1/2] cpuidle: menu: avoid expensive square root computation Rasmus Villemoes
2016-02-16 19:19 ` [PATCH 2/2] cpuidle: menu: help gcc generate slightly better code Rasmus Villemoes
2016-02-16 23:20 ` Rafael J. Wysocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56C3AEB2.4000007@intel.com \
--to=rafael.j.wysocki@intel.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=eric.dumazet@gmail.com \
--cc=fengguang.wu@intel.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mingo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox