Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751968AbbFBTn6 (ORCPT ); Tue, 2 Jun 2015 15:43:58 -0400 Received: from mga11.intel.com ([192.55.52.93]:36011 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751049AbbFBTnv (ORCPT ); Tue, 2 Jun 2015 15:43:51 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,541,1427785200"; d="scan'208";a="501704794" Date: Tue, 2 Jun 2015 12:43:50 -0700 From: Andi Kleen To: Andy Lutomirski Cc: Thomas Gleixner , Adrian Hunter , LKML , Linus Torvalds , X86 ML , "H. Peter Anvin" , Len Brown Subject: Re: [PATCH RFC] x86, tsc: Allow for high latency in quick_pit_calibrate() Message-ID: <20150602194350.GN1187@tassilo.jf.intel.com> References: <1432194944-29087-1-git-send-email-adrian.hunter@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1383 Lines: 34 On Tue, Jun 02, 2015 at 12:41:27PM -0700, Andy Lutomirski wrote: > On Tue, Jun 2, 2015 at 12:33 PM, Thomas Gleixner wrote: > > On Thu, 21 May 2015, Adrian Hunter wrote: > > > >> If it takes longer than 12us to read the PIT counter lsb/msb, > >> then the error margin will never fall below 500ppm within 50ms, > >> and Fast TSC calibration will always fail. > > > > So finally the legacy PIT emulation takes longer than the 30 years old > > hardware implementation. Progress! > > > >> This patch detects when that will happen and switches to using > >> a slightly different algorithm that takes advantage of the PIT's > >> latch comand. > > > > Is there really no smarter way to figure out the TSC frequency on > > modern systems? > > I just asked Len this question yesterday. intel_pstate can do it, > although the algorithm is a bit gross. intel_pstate needs to know the model number. If you know the model number sure you can do a lot better (e.g. using the ref-clock fixed counter or some other methods) But if you don't you need something else. And at some point the only thing left over is the PIT. -Andi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/