Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965427AbcKKAA6 (ORCPT ); Thu, 10 Nov 2016 19:00:58 -0500 Received: from mga02.intel.com ([134.134.136.20]:46688 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934620AbcKKAA4 (ORCPT ); Thu, 10 Nov 2016 19:00:56 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,620,1473145200"; d="scan'208";a="29926334" Date: Thu, 10 Nov 2016 16:06:34 -0800 From: Bin Gao To: Thomas Gleixner Cc: Ingo Molnar , H Peter Anvin , x86@kernel.org, Peter Zijlstra , linux-kernel@vger.kernel.org, Bin Gao Subject: Re: Re: [PATCH 2/2] x86: use KNOWN_FREQ and RELIABLE TSC flags on certain processors/SoCs Message-ID: <20161111000634.GC217763@worksta> References: <1478020482-231459-1-git-send-email-bin.gao@intel.com> <1478020482-231459-3-git-send-email-bin.gao@intel.com> <4460FA1017EA3844B646E90DA4E984057E2ECB85@ORSMSX112.amr.corp.intel.com> <20161110232001.GB217763@worksta> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1351 Lines: 27 On Fri, Nov 11, 2016 at 12:26:40AM +0100, Thomas Gleixner wrote: > On Thu, 10 Nov 2016, Bin Gao wrote: > > > > @@ -702,6 +702,15 @@ unsigned long native_calibrate_tsc(void) > > > > } > > > > } > > > > > > > > + setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ); > > > > > > I can understand the one below, but this one changes existing behaviour w/o explaining why this is correct and desired. If at all then this wants to be a seperate patch and not just mingled in your goldmont update. > > > > native_calibrate_tsc() implements determining TSC frequency via CPUID. > > The purpose to add X86_FEATURE_TSC_KNOWN_FREQ flag is exactly for this case: > > TSC frequency determined via CPUID or MSR are always correct and the whole > > calibration should be skipped. > > Did you actually verify that this is correct and does not introduce NTP > issues compared to the long term calibration on such platforms? > > We've been burnt before and myself and others wasted enough time already > debugging that crap. Yes, we had a 24 hours test before on one of the CPUID capable platforms. With PIT calibrated frequency, we got more than 3 seconds drift whereas with CPUID determined frequency we only got less than 0.5 second drift. Another fact is that on MSR capable platforms, PIT/HPET is generally not available so calibration won't work at all.