From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 428E5C76188 for ; Tue, 23 Jul 2019 07:17:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 167B222ADF for ; Tue, 23 Jul 2019 07:17:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388271AbfGWHRp (ORCPT ); Tue, 23 Jul 2019 03:17:45 -0400 Received: from foss.arm.com ([217.140.110.172]:49754 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbfGWHRp (ORCPT ); Tue, 23 Jul 2019 03:17:45 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8981A344; Tue, 23 Jul 2019 00:17:44 -0700 (PDT) Received: from big-swifty.misterjones.org (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8E2273F71F; Tue, 23 Jul 2019 00:19:44 -0700 (PDT) Date: Tue, 23 Jul 2019 08:17:41 +0100 Message-ID: <86k1c9nrsa.wl-marc.zyngier@arm.com> From: Marc Zyngier To: Pavel Tatashin Cc: Thomas Gleixner , John Stultz , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Will Deacon , Catalin Marinas , Mark Rutland , Linux ARM , LKML Subject: Re: [PATCH 0/3] arm64: Allow early timestamping of kernel log In-Reply-To: References: <20190722103330.255312-1-marc.zyngier@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: ARM Ltd MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 Jul 2019 21:52:42 +0100, Pavel Tatashin wrote: > > On Mon, Jul 22, 2019 at 3:33 AM Marc Zyngier wrote: > > > > So far, we've let the arm64 kernel start its meaningful time stamping > > of the kernel log pretty late, which is caused by sched_clock() being > > initialised rather late compared to other architectures. > > > > Pavel Tatashin proposed[1] to move the initialisation of sched_clock > > much earlier, which I had objections to. The reason for initialising > > sched_clock late is that a number of systems have broken counters, and > > we need to apply all kind of terrifying workarounds to avoid time > > going backward on the affected platforms. Being able to identify the > > right workaround comes pretty late in the kernel boot, and providing > > an unreliable sched_clock, even for a short period of time, isn't an > > appealing prospect. > > > > To address this, I'm proposing that we allow an architecture to chose > > to (1) divorce time stamping and sched_clock during the early phase of > > booting, and (2) inherit the time stamping clock as the new epoch the > > first time a sched_sched clock gets registered. > > Could we have a stable clock config for arm64: if it is known that > this Linux build is going to run on non-broken firmware, and with a > known stable cntvct_el0 register it can be optionally configured to > use that stable sched_clock instead of generic clock that arm64 is > using? Hmmm. Then I guess a prerequisite is this patch: https://lwn.net/Articles/490040/ as the number of systems this will reliably run on is a close approximation to zero. Yes, counting is hard... More seriously, we've been there before (cue the 32bit ARM port 8 years ago), and really don't want to go back to a time where we had multiple config options for everything. There is one kernel, which should run *reliably* on everything. > This way, the early printk are going to be available on those > systems without adding a different method for printk's only. It would > also mean that other users of early sched_clock() such as ftrace could > benefit from it. See above. But maybe the real thing to do is to allow local_clock() to be overridden. Same effect, same complexity, just hidden away from any given subsystem. Thanks, M. -- Jazz is not dead, it just smells funny.