From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933301AbcBPXUY (ORCPT ); Tue, 16 Feb 2016 18:20:24 -0500 Received: from mga14.intel.com ([192.55.52.115]:32651 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756250AbcBPXUX (ORCPT ); Tue, 16 Feb 2016 18:20:23 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,457,1449561600"; d="scan'208";a="913729048" Subject: Re: [PATCH 1/2] cpuidle: menu: avoid expensive square root computation To: Rasmus Villemoes References: <1455650361-26596-1-git-send-email-linux@rasmusvillemoes.dk> Cc: Andi Kleen , Andi Kleen , Ingo Molnar , akpm@linux-foundation.org, lenb@kernel.org, Eric Dumazet , Fengguang Wu , linux-kernel@vger.kernel.org From: "Rafael J. Wysocki" Organization: Intel Technology Poland Sp. z o. o., KRS 101882, ul. Slowackiego 173, 80-298 Gdansk Message-ID: <56C3AEB2.4000007@intel.com> Date: Wed, 17 Feb 2016 00:20:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1455650361-26596-1-git-send-email-linux@rasmusvillemoes.dk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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