Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp980277imm; Fri, 1 Jun 2018 13:02:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIPnDnNcqzPLUdI0UuMmrnRgmt5J2k7ElPv6Zk9bMxgcgMJ/0EKBEIew3+rHftMwUv4tC5E X-Received: by 2002:a17:902:a718:: with SMTP id w24-v6mr12652286plq.45.1527883332559; Fri, 01 Jun 2018 13:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527883332; cv=none; d=google.com; s=arc-20160816; b=B2bFNQ9C6kIVBwZh+jnS+ZK3Mv516PbcVVoOJverI1MZwjks3lMaFmeDr+1XCJAcOo hQVFy3lghaTDbJ+bj9vejaytIBQLMBZZCWtXq72/nhkY9+C6wKci1+3TNFtYOjjfWrUt B/p+v154ANJjhNvtvl6Tr3cxCJVHWzK9nw0jKZv18an6CJLKZCnT+DxA7b+BAe2nw8bj 7538RGLW9fwA+pF+RY73WHe7OKp1CqT5I9TgjDZTtas+WlAb/YcybZUcRq6yTUYv89ov pU6KLAf0VsO2fj9Melni67z0igTlgPorkyQbe+dhuWs7PA5ePyACGaMlr9JdtRN56bTD WPmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=kqwqQ5EiWbp/vNraM/2cL+EaJTPOTFH2HZ6Dpz3WBr8=; b=aLsDvnpvgFdDA5X1npDju0x0J7S6X9sLT+p+4P9YteNzF1AuVqbuPfBKo+61HTyeOD BVAvxaN6FM9CcJjk/GSPsNcV7Yr2SpleG0alLoYzLMFE4Of1veBaK2PjsG4rbeDnm+h3 D6rWFQTB5ByjF2B7Z0Gt/uNki1bV4MIswEnF5nmpeY1mMsBSrwF+eaMt/Zso+x5dlEJX UBsvHhQH+3DEsXkBoabpFzD5zT5k0A5qCRyHk3Ka3H9FGBQ69ez4oT7pDPo7zEkiND0D 3r1qlnGginA7PEYyYNyMoQ4vTSJJsy1ORRsce4tnQfRxe90asimzvVqepsNuOQN/lVeK xS0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=N5yLBJOH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4-v6si39481982plr.373.2018.06.01.13.01.58; Fri, 01 Jun 2018 13:02:12 -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=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=N5yLBJOH; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753474AbeFAUBL (ORCPT + 99 others); Fri, 1 Jun 2018 16:01:11 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:34340 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753080AbeFAUBJ (ORCPT ); Fri, 1 Jun 2018 16:01:09 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w51JpGRa193426 for ; Fri, 1 Jun 2018 20:01:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : references : in-reply-to : from : date : message-id : subject : to : cc : content-type; s=corp-2017-10-26; bh=kqwqQ5EiWbp/vNraM/2cL+EaJTPOTFH2HZ6Dpz3WBr8=; b=N5yLBJOHJe0kkuysmTal8TXvG6CAXjEPmUnl9j/1/DQ44YSlVPjHWdysmPEScQfc/0Q0 fXatVQoN9VdH3sJkjeEy9wz93Zq24xYoBl7kxCSSkwCriX2Ob3ASwn0zoKXLZiiMy8eO gAzKeb8MHiZ9kGTyJnQ67WlDxWqXImvGdGsJByZnMZvQDjL5EI+9XPGDKxPp7wjgSnhy PPjgfkO7OWhIB54xao/z6468kOcF0BCYMX/Px50h+tdLK1lict3taNuXyFOkmSIXutDR pyWEMH/DwimKs7YLulknVnrO6C5AxxXxsHAQ7EzYX07g8FLYRFX2IdSU9B2JFJ3HhJ7X SQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2janje5yvg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 01 Jun 2018 20:01:08 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w51K15wW002282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 1 Jun 2018 20:01:06 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w51K15oF010878 for ; Fri, 1 Jun 2018 20:01:05 GMT Received: from mail-ot0-f176.google.com (/74.125.82.176) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 01 Jun 2018 20:01:05 +0000 Received: by mail-ot0-f176.google.com with SMTP id i19-v6so84601otk.10 for ; Fri, 01 Jun 2018 13:01:04 -0700 (PDT) X-Gm-Message-State: APt69E1GlpNMCrWSF53GpBlFR77AA7aR7rgDv/+0QB8hH4GJrd1TeeJu LyKF10fyvGqTwNM8Hf9R7u8ILCPHV1Fm5yT3Fsk= X-Received: by 2002:a9d:72dd:: with SMTP id d29-v6mr8543410otk.345.1527876369908; Fri, 01 Jun 2018 11:06:09 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <20180531155210.GL12180@hirez.programming.kicks-ass.net> From: Pavel Tatashin Date: Fri, 1 Jun 2018 14:05:33 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp To: peterz@infradead.org Cc: pmladek@suse.com, feng.tang@intel.com, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com, gnomes@lxorguk.ukuu.org.uk, LKML , alek.du@intel.com Content-Type: text/plain; charset="UTF-8" X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8911 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=862 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806010230 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, How about taking patches 1-4 and 7 ? I can work on patches 5 & 6 separetly to provide a better integration for x86, this can be decided separetly but the other patches will enable early clock functionality on arches where sched_clock() is available early. Pavel On Thu, May 31, 2018 at 11:52 AM 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.