Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp756519imm; Thu, 31 May 2018 08:53:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKObIR7U3AFPv89UcwGj7+ojtov2EpdXrxgJ4p7HpZB2HyUtRDtL2EgPtLWbI+ciS4YRlbq X-Received: by 2002:a63:9041:: with SMTP id a62-v6mr5963043pge.191.1527781983005; Thu, 31 May 2018 08:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527781982; cv=none; d=google.com; s=arc-20160816; b=ShC8wgcI9EJl5MJ33rCrxmyqBLDvEasA6tozCFbhR9F7WQnkrEVid9mTuWDpwjOhdL uHCBi4VA6csjU74tLTuEleFHgbDvDIbi1FCG6wDKSFO6FD2TQkmuboPJ0Q5PN76pSn6U xPBw/u/MdrIFEcBAOlZPSKZU1MVFYZ5G1h55EpJTYWJNR/nI9SDJNcfPnrcFg6JPKrlD 7gSs/z+jSESsg/2G3TjF9kjZDerzqvJ7FITeGxWho0USv9/vyAGLEtIuXhPhTVRAOlhO z0B6/iZ6HmAVclfgd8x67+npsGZq6EPuuqtCgvhZtPAn0DIcpmTNmaiVoEGubRkDAsnv QQDw== 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=DtI+ggqGOjgPJe5wYp1qjcCTTHqrxlO7EmRu/4E3CzY=; b=Pi3GK0k+plIskocTqD6ooLXAo1hptI1aUqYn/0xDNv6+woC2B15OnI7YhS/U9zV7o3 Y2/rAeozFYMwbBRbu/rngE80S4+FymTiYcYqY74BmWkSwMn6n9z/3f4R95BUs9ib58DW y+2rNhhNac6pCkR3iCL1PA8S8grq0KwOWk8S8qmJkxh2Anvr1vAncLc7+gsuwvjV1rHJ wd3ZCuvIeCADO/t6lXlJE+nvPgso4vNCT4u765NguQqxpGDEmqKgCcvnAlGhOS3OCtTD CzLL3PL3ZR6tfdEdqydWe1wOwZk6oZzuQvxnjsYh0sKaglZ2il4n5tgKKud0xQx9A56v ygPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YsOWvrM6; 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 f85-v6si37280590pfj.125.2018.05.31.08.52.47; Thu, 31 May 2018 08:53:02 -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=YsOWvrM6; 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 S932139AbeEaPwV (ORCPT + 99 others); Thu, 31 May 2018 11:52:21 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38430 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755417AbeEaPwU (ORCPT ); Thu, 31 May 2018 11:52:20 -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=DtI+ggqGOjgPJe5wYp1qjcCTTHqrxlO7EmRu/4E3CzY=; b=YsOWvrM6DOB6vnw8fN9ly3fhy +W9aZVviewy3P0XPtpMVipq41PK3Gwr6o2X07GBhSBzYo8HTE1HTlC4XcGzmdguliszbA9a9O9ncc 9Udo9JYIoFXK6mLl0u14/byytdZYEfzOXpYrOKVYNpH+DJJGYZbSkT/jvUfoy0S0wWUSxNHSyX2t/ ALJBtNaib2bQUYKP7flNZNxg06QKUIAN3SsuCuoOb2C/Yor6r3dDE9298Zl6ZW7NobwIN7m6iwvGV OVAikBd3/RLd5e1V81nZVdI49YPRNIH4uuXIb4OCITmJr0Gsv2UEa64AfX+oUaq1BO/Dr1wkGaFFs s+Dsi8ecw==; 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 1fOPs4-0001vY-5V; Thu, 31 May 2018 15:52:12 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6F428202ACE62; Thu, 31 May 2018 17:52:10 +0200 (CEST) Date: Thu, 31 May 2018 17:52:10 +0200 From: Peter Zijlstra To: Petr Mladek Cc: Feng Tang , Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" , Alan Cox , linux-kernel@vger.kernel.org, alek.du@intel.com, pasha.tatashin@oracle.com Subject: Re: [RFC 2/2] x86, tsc: Enable clock for ealry printk timestamp Message-ID: <20180531155210.GL12180@hirez.programming.kicks-ass.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180531135542.4j7w7bxsw43ydx3j@pathway.suse.cz> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.