From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755542AbbIAI5P (ORCPT ); Tue, 1 Sep 2015 04:57:15 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:49472 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755190AbbIAI5M (ORCPT ); Tue, 1 Sep 2015 04:57:12 -0400 Date: Tue, 1 Sep 2015 10:57:03 +0200 From: Peter Zijlstra To: Adrian Hunter Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Andy Lutomirski , Thomas Gleixner , linux-kernel@vger.kernel.org, Stephane Eranian , Andi Kleen Subject: Re: [PATCH V3] perf: x86: Improve accuracy of perf/sched clock Message-ID: <20150901085703.GJ16853@twins.programming.kicks-ass.net> References: <55D6C961.9040303@intel.com> <1440147918-22250-1-git-send-email-adrian.hunter@intel.com> <55E56396.3090708@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55E56396.3090708@intel.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 01, 2015 at 11:36:38AM +0300, Adrian Hunter wrote: > On 21/08/15 12:05, Adrian Hunter wrote: > > When TSC is stable perf/sched clock is based on it. > > However the conversion from cycles to nanoseconds > > is not as accurate as it could be. Because > > CYC2NS_SCALE_FACTOR is 10, the accuracy is +/- 1/2048 > > > > The change is to calculate the maximum shift that > > results in a multiplier that is still a 32-bit number. > > For example all frequencies over 1 GHz will have > > a shift of 32, making the accuracy of the conversion > > +/- 1/(2^33). That is achieved by using the > > 'clocks_calc_mult_shift()' function. > > > > Signed-off-by: Adrian Hunter > > Ping? I've queued it. Thanks