Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1558612imm; Thu, 19 Jul 2018 04:02:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4+KxhBRxvRzr2npdX8aG7AQAlVXikqIcpAMbCso3rbUa2qMoUMB6YNEpfzKK04zxd8Rra X-Received: by 2002:a63:3d41:: with SMTP id k62-v6mr9587392pga.254.1531998166570; Thu, 19 Jul 2018 04:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531998166; cv=none; d=google.com; s=arc-20160816; b=k7rrHlZT6NFeUvJ1TTNWrJeeuD8HpQrUIXya2FSO74G1mzzyqsMJ6xmjJgAq1/4Hf9 41Tx7bm33sLwhWnFKXcqoM0VXasU6yBR1hp5yJALI1ejUjciLtJirW/oc5C+AdCffQCz mAG+Kmi6+AGkMNQcB899doaF1cGoA3R4Jj8/jEOde/nK+e9wJPuIP+s/PY9dVs8mo2zX Qll0XYZfkLOX3AOgzmn6oj0bWV9KnyHsO6nOpDi2PEM9qJCZbT2NQyNJ8RffSU17NYU4 gOV0nOJ2o5T0K4QLfDfuhPLIqCTsmwvEAdqG72uq7OVf92vgcd+RVvjPiDy/guSIeGDV Wfcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=L4l2ZyJd5KNUUg/CpRmCojZ8uweDY0G0OKVAEGBlFFk=; b=BPU32c5Kxu5L1jE+aW+fEElVEEsDH9fjr4aguxLdAfhsQT2HmeCxrabLvia+hfn9Nx HY/dsfW7jYoxp/R7wkCUMaZXZujHAdnELP29k02W8RVITnc2Fgds+gsEaqhU2Krq1M6f WHHlQL4eErB9yzjiH/Ybkwmz4HSTcdTi2gvGMIXjXtlq9An3z3LV3XdcBb01lrUaP/o+ dUIdqT78uPadawtaf1wQrPD6iId2kk10ZCgm5BG+MmvIpYfpzRpTnzgd66j74V23MS4y fykDjsB/0zHz35Sm7BPrw4bVa51cLq2+L56HUcPn6PQvDQ2FgvI0OrG6jHpTwTgsyEHa solA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x21-v6si5249982pll.24.2018.07.19.04.02.31; Thu, 19 Jul 2018 04:02:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731178AbeGSLoa (ORCPT + 99 others); Thu, 19 Jul 2018 07:44:30 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:60978 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726930AbeGSLoa (ORCPT ); Thu, 19 Jul 2018 07:44:30 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fg6gU-00068M-NV; Thu, 19 Jul 2018 13:01:22 +0200 Date: Thu, 19 Jul 2018 13:01:22 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: Pavel Tatashin , steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux@armlinux.org.uk, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, john.stultz@linaro.org, sboyd@codeaurora.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com, douly.fnst@cn.fujitsu.com, prarit@redhat.com, feng.tang@intel.com, pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk, linux-s390@vger.kernel.org, boris.ostrovsky@oracle.com, jgross@suse.com, pbonzini@redhat.com Subject: Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once In-Reply-To: <20180719103340.GA2494@hirez.programming.kicks-ass.net> Message-ID: References: <20180718022211.6259-1-pasha.tatashin@oracle.com> <20180718022211.6259-21-pasha.tatashin@oracle.com> <20180719103340.GA2494@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Jul 2018, Peter Zijlstra wrote: > On Tue, Jul 17, 2018 at 10:22:06PM -0400, Pavel Tatashin wrote: > > During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), > > and the second time in tsc_init(). > > > > Rename tsc_early_delay_calibrate() to tsc_early_init(), and rework it so > > the calibration is done only early, and make tsc_init() to use the values > > already determined in tsc_early_init(). > > > > Sometimes it is not possible to determine tsc early, as the subsystem that > > is required is not yet initialized, in such case try again later in > > tsc_init(). > > It might be nice to preserve some of the information tglx dug out during > review of all this. Like the various methods of calibrate_*() and their > dependencies. > > And I note that this patch relies on the magic of native_calibrate_cpu() > working really early and not exploding in the quick calibration run. > This either wants fixing or documenting. > > I think the initial idea was to only do the fast_calibrate (cpuid, msr > and possibly the quick_pit) things early and delay the HPET/PMTIMER > magic until later. Yes. I really would prefer to have this as an explicit expressed mechanism rather than relying on magic variables not being initialized. Thanks tglx