Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1538879imm; Thu, 19 Jul 2018 03:37:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcygJLp955/mAZYqzmwAREgEVm1lL7izA4D147LxCB9nmzTkYQk/viEV2Wm3K78N/bZcuRf X-Received: by 2002:a17:902:a702:: with SMTP id w2-v6mr9689646plq.41.1531996677600; Thu, 19 Jul 2018 03:37:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531996677; cv=none; d=google.com; s=arc-20160816; b=Wpx1vFHrXy9KOCiyhxuEtoD1vve87MEcM2tK1J6HVkkbp4Ng4e9nlyQ3YetoQusf79 tHkFfy2OgrTw271YbV3Q/iB2W0wrRhItyeBbfxJv809HUNCCYL21OK6WPJLEZ8yR54sM T/1cQEMgbME8dgt8FLv7pauFF92Xm/2ZAuj9G3xHz3LGYBqhSn9mKhl5UGpxhmDUKsOB nKx1q7nJrtLu6WidNRCibc7cbUyPPE3d0ve7kJmI97BgI+qc5WdVHLqJrNPJHPfjeM8E PRaTmTtlY21CAKVHRbrmS/5dyCQgzkqCdHsLUOBHY4lgokocWuKzaBix3JEoWmdZPu70 pN0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=GZU7/Jg9QgvJ79XlZwq4RTMJ18LO6g2ICcqmNVAasQk=; b=KuanWM/r7ATqs8gIODWtPzsqebBRPOaTC0kb9V6O2O+3dHtuvTnATlRclBDgoudB1I Yrj/ZnYFhaxOcGKBENokayaVYQq/dI1el6EkHzRQTy5g6h+C+keDhpzFvXEoiFnyk7s4 AD08m/tzKcCEa/KB0Gd4zbjN0g+QApvJ4WuWxYzTTntMTrfmMDXSfY+w7FqfZSy1MsvT 2rHtI2BelV44lUsuUWqHgpfa3Q/LWtbzqx6R+Ch1+tUyXHepXCUCwcb0HnzSTTcZFU5Z VK5hGlucDqXpZGP1iVUvsI3bRAOS2diFHvIk72VHkNOV9ZAfGySbJpyj2vdLmnNYh7Vg 3ksg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YzddsPPv; 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 i8-v6si5196208pfo.128.2018.07.19.03.37.19; Thu, 19 Jul 2018 03:37:57 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YzddsPPv; 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 S1730919AbeGSLQi (ORCPT + 99 others); Thu, 19 Jul 2018 07:16:38 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38324 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727459AbeGSLQh (ORCPT ); Thu, 19 Jul 2018 07:16:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=GZU7/Jg9QgvJ79XlZwq4RTMJ18LO6g2ICcqmNVAasQk=; b=YzddsPPvjeGM3KGYUJnhQSG3j jrU5OD7uwpX8DziK3sDzxLAGTf2cXTX/Q2EXLGqkl2kpfW3T7QY5YWGJKOWV8PTvCKQxCEyfc+36o oD4qoSSSE0iL15N772GQu6b9pEPu433McNbkQT+rCefX4rToAbVlQaSdTegAqrps1SvEuW5PtWo3D cT8JxxVn4jywfhme6Ozk/WOF/G07AcO9/n25t8QIxNH3Js1en8WW6Y0oPGvqTV4+zp5Xc/mxDLG7f 0HuTVhJTvR0JesAcx59sVxuwBMtFPsK1zKd0fF0EVyV52pbkNJEpV9WurgrIHtPpiG2IqF3edypBO +XvZc++NQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fg6Fi-000561-W0; Thu, 19 Jul 2018 10:33:43 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7F73420289335; Thu, 19 Jul 2018 12:33:40 +0200 (CEST) Date: Thu, 19 Jul 2018 12:33:40 +0200 From: Peter Zijlstra To: Pavel Tatashin Cc: 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, tglx@linutronix.de, 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 Message-ID: <20180719103340.GA2494@hirez.programming.kicks-ass.net> References: <20180718022211.6259-1-pasha.tatashin@oracle.com> <20180718022211.6259-21-pasha.tatashin@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180718022211.6259-21-pasha.tatashin@oracle.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.