From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751338AbcBJNbK (ORCPT ); Wed, 10 Feb 2016 08:31:10 -0500 Received: from mga11.intel.com ([192.55.52.93]:11177 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbcBJNbI (ORCPT ); Wed, 10 Feb 2016 08:31:08 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,426,1449561600"; d="scan'208";a="650080241" Date: Wed, 10 Feb 2016 21:31:05 +0800 From: Fengguang Wu To: Andi Kleen Cc: Rasmus Villemoes , 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 Message-ID: <20160210133105.GB22162@wfg-t540p.sh.intel.com> References: <1454017365-8509-1-git-send-email-andi@firstfloor.org> <87y4b4azsy.fsf@rasmusvillemoes.dk> <20160201213622.GA15302@tassilo.jf.intel.com> <874mdkfbpx.fsf@rasmusvillemoes.dk> <20160209204400.GC4875@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160209204400.GC4875@tassilo.jf.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 09, 2016 at 12:44:00PM -0800, Andi Kleen wrote: > On Sun, Feb 07, 2016 at 10:32:26PM +0100, Rasmus Villemoes wrote: > > 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? > > I got the numbers from the 0day runs (AIM7 gets faster) > In theory if you post the patch that should happen automatically > (checking with Fengguang) Yes we bisect and report a lot of runtime performance changes. On the other hand, some few will be missed, too, due to various unstableness issues. Anyway if you would like to study performance impacts of a patch, feel free to send us requests to gather the numbers and do comparison. Thanks, Fengguang