From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754518AbbHQJ4h (ORCPT ); Mon, 17 Aug 2015 05:56:37 -0400 Received: from casper.infradead.org ([85.118.1.10]:36491 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbbHQJ4g (ORCPT ); Mon, 17 Aug 2015 05:56:36 -0400 Date: Mon, 17 Aug 2015 11:56:17 +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 V2] perf: x86: Improve accuracy of perf/sched clock Message-ID: <20150817095617.GA20948@worktop> References: <1438118085-3641-1-git-send-email-adrian.hunter@intel.com> <55D18E6B.1040402@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55D18E6B.1040402@intel.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 17, 2015 at 10:34:03AM +0300, Adrian Hunter wrote: > On 29/07/15 00:14, 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) > > > > Signed-off-by: Adrian Hunter > > Is this OK? Yes I think so, sorry I got backlogged with preparation for Seattle. Thomas, if you see this, could you merge with my ACK on, otherwise I'll queue it the normal route once I'm back.