Received: by 10.223.164.221 with SMTP id h29csp2857389wrb; Thu, 2 Nov 2017 19:55:33 -0700 (PDT) X-Google-Smtp-Source: ABhQp+S0MltbX4AMZLGJG1AmP90Uk01vQ62969iSTsZDISAqBRN4JmaIDGhX4fAbq8hYSWpNKjFo X-Received: by 10.99.189.18 with SMTP id a18mr5627888pgf.168.1509677733512; Thu, 02 Nov 2017 19:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509677733; cv=none; d=google.com; s=arc-20160816; b=m5Rr/imoPI1IjZE2hvhyAXpp16oId8xAyMyy6mC1FCIoDdtfUaZzPXhcSPTx5oSOlC PBUjgSMAQ1XDoNTZil02mfKli2FpRPZG50soySXDcpNmHx9XBEGkt9YsgVGiPF6fPRbU MjpcUbwGyFhzgtlP1ZUopcUC2VvVIWtZer2DOFs4Jf4mpCwSdlvPuT7lLCffpNr09EQX ULUC180QzI0T0boQ5/47Bt96QohIDNBlkEsTU1p6jEU74FKVpaULj8vdoZBNbbN++zBF YUyTpTj7rg81EbgeGcyZHNMZmKmWYoSuZktPeFtN6+V0rXrNf+/UXWnYMpqEIkTvdMNh ceFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=zkj3dLnbiDryTAVtxvgLZ864BX6o01deLQ0TfgT9up4=; b=VzgwgxyP0gonNtNI+bkQtYDXSXm+Auzy31uMHuqK6z4+whKdRsilkcHEZWUerA0kqP QS6+ydwlwzbL4UBkh+TwGrJelfgfIaRc/563bym0XUGNxINVnUTR2+28OUeaNM65b82O x2hmvqvClNftkpwuNZ+RZCxTJC+V5AWPSTUAOOTjxrfG4ul7FICEjTGxDl7yXPIqhrnN 3dCdLT8jqyZxk5e6PlYyaIKMnIvCHgYqP6wkIng3t/J7dmm9aD235RwUhhsqgLystO0S 2u2aX5UOKpPywn8qaYATNLdTdK4ZNUJ6r37wLKZayDU+st20cnh92cn4w6QqNXNJ/TsZ 9vRA== 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 u7si3167486plr.807.2017.11.02.19.55.18; Thu, 02 Nov 2017 19:55:33 -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 S1752559AbdKCCyj (ORCPT + 97 others); Thu, 2 Nov 2017 22:54:39 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:53109 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751507AbdKCCyi (ORCPT ); Thu, 2 Nov 2017 22:54:38 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="29862271" Received: from localhost (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Nov 2017 10:54:33 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id 15EA748089C2; Fri, 3 Nov 2017 10:54:31 +0800 (CST) Received: from localhost.localdomain (10.167.226.106) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 3 Nov 2017 10:54:30 +0800 Subject: Re: [PATCH v7 6/6] x86/tsc: use tsc early To: Pavel Tatashin , , , , , , , , , , , , References: <20171102172644.28555-1-pasha.tatashin@oracle.com> <20171102172644.28555-7-pasha.tatashin@oracle.com> From: Dou Liyang Message-ID: Date: Fri, 3 Nov 2017 10:54:26 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20171102172644.28555-7-pasha.tatashin@oracle.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 15EA748089C2.AF19D X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, At 11/03/2017 01:26 AM, Pavel Tatashin wrote: > tsc_early_init(): > Determines offset, shift and multiplier for the early clock based on the > TSC frequency. > > tsc_early_fini() > Implement the finish part of early tsc feature, prints message about the > offset, which can be useful to find out how much time was spent in post and > boot manager (if TSC starts from 0 during boot) > > sched_clock_early(): > TSC based implementation of early clock. > > Call tsc_early_init() to initialize early boot time stamps functionality on > the supported x86 platforms, and call tsc_early_fini() to finish this > feature after permanent clock has been initialized. > > Signed-off-by: Pavel Tatashin > --- > arch/x86/include/asm/tsc.h | 4 +++ > arch/x86/kernel/setup.c | 10 ++++-- > arch/x86/kernel/time.c | 1 + > arch/x86/kernel/tsc.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 94 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/include/asm/tsc.h b/arch/x86/include/asm/tsc.h > index f5e6f1c417df..6dc9618b24e3 100644 > --- a/arch/x86/include/asm/tsc.h > +++ b/arch/x86/include/asm/tsc.h > @@ -50,11 +50,15 @@ extern bool tsc_store_and_check_tsc_adjust(bool bootcpu); > extern void tsc_verify_tsc_adjust(bool resume); > extern void check_tsc_sync_source(int cpu); > extern void check_tsc_sync_target(void); > +void tsc_early_init(unsigned int khz); > +void tsc_early_fini(void); > #else > static inline bool tsc_store_and_check_tsc_adjust(bool bootcpu) { return false; } > static inline void tsc_verify_tsc_adjust(bool resume) { } > static inline void check_tsc_sync_source(int cpu) { } > static inline void check_tsc_sync_target(void) { } > +static inline void tsc_early_init(unsigned int khz) { } > +static inline void tsc_early_fini(void) { } > #endif > > extern int notsc_setup(char *); > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c > index 0957dd73d127..3df8be642b80 100644 > --- a/arch/x86/kernel/setup.c > +++ b/arch/x86/kernel/setup.c > @@ -822,7 +822,11 @@ dump_kernel_offset(struct notifier_block *self, unsigned long v, void *p) > return 0; > } > > -static void __init simple_udelay_calibration(void) > +/* > + * Initialize early tsc to show early boot timestamps, and also loops_per_jiffy > + * for udelay > + */ > +static void __init early_clock_calibration(void) Commit: eb496063c990 ("x86/timers: Move the simple udelay calibration to tsc.h") moves this function to tsc.h and renames it in tip tree[1]. I guess using this commit, we can simplify this patch. As this series, except the 2rd patch, is worked for x86, how about let this series be based on tip. BTW, I am testing your patches, will give you result later. [1] https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git Thanks, dou From 1582976236433299239@xxx Thu Nov 02 17:29:40 +0000 2017 X-GM-THRID: 1582976236433299239 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread