Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp769583imm; Fri, 1 Jun 2018 09:12:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ9Zgg8zY6I88wA9tG1IBBy2DYz3SZc22Cm3nRWRXI55oSQNevbESLLc2324wm1c6joFzB1 X-Received: by 2002:a17:902:7446:: with SMTP id e6-v6mr11676800plt.382.1527869557807; Fri, 01 Jun 2018 09:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527869557; cv=none; d=google.com; s=arc-20160816; b=k+aWbb0cZDnJ6+ZRQD0d4I3pJeKQcobUGuSay/l9C2slJsNJ7/zjVNSdfiToxx5EXo k5pQAfdBrOe+sGPou9k16LCjZaxHf+akvJfXS543Bz+Nm1k1CzhizHZXLHvQW0jPWvMN KLZ5uV3uSUUT98MxmiSGzezQ3RGxIfaNySNYTfAMb2SdqPH71mLpsFWkWd86eHRpdUza 74pJkf/BII3s+O7gomgLStkOdji9bcUJzeza4DRdUQ8ivELvgjivgial96kZo7Jx/tCz 5TG4yekFbDmCqtngv/edqDA8Z8Qp4YAidLzL7CHSZftm8Bi81gbI0ypeLUbAmxqTv0rG b9Dw== 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:arc-authentication-results; bh=9Z2WTfKPmJLZ3pY2hD17Uj0zsGzeHbYf76Qs8LWOJV8=; b=pfJBnoQn6apRy4fq1YJ/y4x0K0dSmW7HzfSl9oHC2fVDSYoVb6iWpE5XeDmeF8A0fc imkRPmy+n9Tk/M7YSuw3ckeaTX1zaFyEGU2E4+JS9i/u1bGUdu14bADS+LoqyzOJnm7A o+bYdUM4P6beZCjdsOV4lY/3QnoP44ZPBvtrI/raN8aJjT8Xh8P9y37UzBJ3/sAFxuoQ A3+4WzRYuGq33QE+chy4fthwNG69V9k9jtjday33FIvAJ+SuAelgDZFJqodkuevJsotQ YB9er9c6CH49rMPSTjKEssHIF5nE/aX8vp+43LzEwNMfJ/tTbH28VzkUAgyc25mQ4f6s YOOg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si13356108plz.379.2018.06.01.09.12.23; Fri, 01 Jun 2018 09:12:37 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753220AbeFAQKj (ORCPT + 99 others); Fri, 1 Jun 2018 12:10:39 -0400 Received: from mga18.intel.com ([134.134.136.126]:12177 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752282AbeFAQKi (ORCPT ); Fri, 1 Jun 2018 12:10:38 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jun 2018 09:10:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,467,1520924400"; d="scan'208";a="59588705" Received: from shbuild888.sh.intel.com (HELO localhost) ([10.239.146.239]) by fmsmga004.fm.intel.com with ESMTP; 01 Jun 2018 09:10:35 -0700 Date: Sat, 2 Jun 2018 00:12:13 +0800 From: Feng Tang To: Peter Zijlstra , Petr Mladek Cc: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" , Alan Cox , linux-kernel@vger.kernel.org, alek.du@intel.com, pasha.tatashin@oracle.com, arjan@linux.intel.com Subject: Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp Message-ID: <20180601161213.tm44nhrhwfxa2767@shbuild888> References: <1527672059-6225-1-git-send-email-feng.tang@intel.com> <1527672059-6225-2-git-send-email-feng.tang@intel.com> <20180531135542.4j7w7bxsw43ydx3j@pathway.suse.cz> <20180531155210.GL12180@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180531155210.GL12180@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter and Petr, Thanks for your suggestions, will try to find a cleaner and less hacky way, and it may take some time as dealing with all kinds of TSC is tricky :) - Feng On Thu, May 31, 2018 at 05:52:10PM +0200, Peter Zijlstra wrote: > On Thu, May 31, 2018 at 03:55:42PM +0200, Petr Mladek wrote: > > I wonder if we could get some cleaner integration into the timer and > > printk code. > > Yes, these patches are particularly horrific.. > > There were some earlier patches by Pavel Tatashin, which attempted do > get things running earlier. > > http://lkml.kernel.org/r/20180209211143.16215-1-pasha.tatashin@oracle.com > > I'm not entirely happy with that, but I never did get around to > reviewing that last version :-( In particuarly, now that you made me > look, I dislike his patch 6 almost as much as these patches. > > The idea was to get regular sched_clock() running earlier, not to botch > some early_sched_clock() into it. > > Basically run calibrate_tsc() earlier (like _waaay_ earlier, it doesn't > rely on anything other than CPUID) and if you have a recent part (with > exception of SKX) you'll get a usable tsc rate (and TSC_RELIABLE) and > things will work. > > If you have a dodgy part (sorry SKX), you'll just have to live with > sched_clock starting late(r). > > Do not cobble things on the side, try and get the normal things running > earlier.