From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932111AbcBGVca (ORCPT ); Sun, 7 Feb 2016 16:32:30 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:34700 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754440AbcBGVc3 (ORCPT ); Sun, 7 Feb 2016 16:32:29 -0500 From: Rasmus Villemoes To: Andi Kleen Cc: Andi Kleen , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, rafael.j.wysocki@intel.com, lenb@kernel.org Subject: Re: [PATCH] Optimize int_sqrt for small values for faster idle Organization: D03 References: <1454017365-8509-1-git-send-email-andi@firstfloor.org> <87y4b4azsy.fsf@rasmusvillemoes.dk> <20160201213622.GA15302@tassilo.jf.intel.com> X-Hashcash: 1:20:160207:linux-kernel@vger.kernel.org::OgcXUUDVdea20s3s:0000000000000000000000000000000000EBO X-Hashcash: 1:20:160207:akpm@linux-foundation.org::riTcLPszyVGe20DG:000000000000000000000000000000000000132e X-Hashcash: 1:20:160207:ak@linux.intel.com::w+gdfwi4C8i7aytr:00000000000000000000000000000000000000000001D+G X-Hashcash: 1:20:160207:lenb@kernel.org::qYOH3FphGsNEL44o:001i4V X-Hashcash: 1:20:160207:rafael.j.wysocki@intel.com::4w81yBiq8ml73IjA:000000000000000000000000000000000004S2K X-Hashcash: 1:20:160207:davidlohr.bueso@hp.com::X2c+thNatt6pPdI8:00000000000000000000000000000000000000037/B X-Hashcash: 1:20:160207:andi@firstfloor.org::aBbG8TkxI5r0nZU/:0000000000000000000000000000000000000000004CNs Date: Sun, 07 Feb 2016 22:32:26 +0100 In-Reply-To: <20160201213622.GA15302@tassilo.jf.intel.com> (Andi Kleen's message of "Mon, 1 Feb 2016 13:36:22 -0800") Message-ID: <874mdkfbpx.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 01 2016, Andi Kleen wrote: > On Mon, Feb 01, 2016 at 10:25:17PM +0100, Rasmus Villemoes wrote: >> On Thu, Jan 28 2016, Andi Kleen wrote: >> >> > From: Andi Kleen >> > >> > The menu cpuidle governor does at least two int_sqrt() each time >> > we go into idle in get_typical_interval to compute stddev >> > >> > int_sqrts take 100-120 cycles each. Short idle latency is important >> > for many workloads. >> > >> >> If you want to optimize get_typical_interval(), why not just take the >> square root out of the equation (literally)? >> >> Something like > > Looks good. Yes that's a better fix. > Andi, did you have a way to measure the impact, and if so, could I get you to run the numbers again with my patch? Thanks, Rasmus