Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1312505ybn; Wed, 25 Sep 2019 16:09:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyE8/cbT17LxKFNzQc4IRFnv0ogI1WyrTevNu4F/FPJ7s22HGSJcquWTV9TTXi3RI+FAQi+ X-Received: by 2002:a50:ac0d:: with SMTP id v13mr462450edc.189.1569452982849; Wed, 25 Sep 2019 16:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569452982; cv=none; d=google.com; s=arc-20160816; b=x7JI9ajbUhKkQAR6rWPPjBHOmZGqdNabmEEBEocNm7s4LvYe/p/0yj2HpvxBvW3mYp BKULapFHL76vY0oAdl4A8GQ4Xv/CAwEYzsLrN4oF35JIcuDHGWEWqp5xxYiRNyHhTjh4 LnFACMcrCaGLRIk2ONYVF1AvmT6W7YhueLRBb+QVDWb4fUOg6aEqa6uF2M+IMNYdtXlz mb3/eTjH8DBHhYZ7CPBd0KsDwCussdtSMjPHHRo0bUjRK3u0IWfN2n4FW1YGl9S/8HLo AjQ0BPHNLxtSi/Zz9T+suO/TE94Bl67TMdNG5ncK5qiP2XAwy8huNQRIMJoA4HVLso85 VqQg== 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; bh=stujTPtuGxuh59HTJ15B3m0skvzv4BxR2W0z7AHqmAs=; b=Ix03iMz2U0qccJk/z8rqMfI4Qot4Z7OW+CymDcPotd19ujMOIHMbddWFgHPu+eh34T DKIsK2a//J3U6vXBElhcPqHG7n36ZNhg9Q2EQZ1TSh5YFlA66rPaPoSrLijQ9225W2Xo QKffEih3+mpJWdSzWK0DOdP9ECQQg1j/3MKssh4SanY6dKIpqNpuIoH0h2uTPbJ8z0yc JQjwM2MPa3K29gmRS1WgOXVRzVimQCKgXI77h4AoqYa5UhF85vb6qlbGp1lvd9uCjBxy lB46J3p8PxZKtuqJW+DFMLf0jqV17CZymtJIRZuRh0ZAGMAbauacNx79Oe6j7DeA6EYX Ay2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=oyQ71NyO; 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 nj7si142085ejb.262.2019.09.25.16.09.18; Wed, 25 Sep 2019 16:09:42 -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=@soleen.com header.s=google header.b=oyQ71NyO; 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 S1733256AbfIWTN0 (ORCPT + 99 others); Mon, 23 Sep 2019 15:13:26 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:41513 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbfIWTNZ (ORCPT ); Mon, 23 Sep 2019 15:13:25 -0400 Received: by mail-ed1-f65.google.com with SMTP id f20so13993508edv.8 for ; Mon, 23 Sep 2019 12:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=stujTPtuGxuh59HTJ15B3m0skvzv4BxR2W0z7AHqmAs=; b=oyQ71NyOLCUCt3yrY4nzC3lmDE+RcloHR0cEYYRhtoJqaMrnTmBYWSRql93lKpdu/2 bQrXfU9nfGQiEaAJlAXpotQPEAdsSUEJzcK1TJZdtDuOUgQpzT68LYoBtLzhCFlZpTRJ sOnLNz+ZCb/ooZ7Iz+F3s9J4d0eKTxzB9FAn34SubnMWewIiyOjoe9FDaI1tIMpIlgun AK+RuOBGaMOfBm1D/kLl4+++0qsBgwRznMqymwyisovqATfNnGBGb/epBk1cSr2HYziZ oBCaqwi4skj15AXxVrdUY03bPLGkEMGpebrDS+lLUEFOg8+Rrbn4NAaqNBqr7ymyjR8s BdVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=stujTPtuGxuh59HTJ15B3m0skvzv4BxR2W0z7AHqmAs=; b=jQyZ2E1ZAiGNtOn1UTLX2cEkGkPu3REUZ2k6awoLktELBbyHkxMkOaPQfC6i8Q75WF wGhE+zLTUgbYEvM2Sheb6kkN5cVIshqOuEx/Vod8SuLHxYKWMO1XaMPYrcr72amP9P3H oWh2JLms3tzkU41B8rWUiYKkOvpjYCKaeloXgywwQqSRMFtkuTlyqAXKcBUBhRHyP2en 4sT7J1biAJ2qb+BMXp999RBFwqFvtEGcF9X9hxbWffGnfSsuuZ6MaggoFVnkA9ENXTbk r5NCCyeeTo1n6n93wRY2BT1N+gUz3Wy3FMDYBBnWF0ha952jbL4JO8J6WPN2kM2Hu6VQ WGAQ== X-Gm-Message-State: APjAAAU4j2Oya4tz5a9QmNA6yqp6HV/spw5ocQU60qlPpXnV57h1E06N Ur0eWL1mPD10vx8Io244qTpo5DlZUQpRrSQRQW9Rfw== X-Received: by 2002:aa7:d7d3:: with SMTP id e19mr1824376eds.80.1569266002752; Mon, 23 Sep 2019 12:13:22 -0700 (PDT) MIME-Version: 1.0 References: <20190722103330.255312-1-marc.zyngier@arm.com> <86k1c9nrsa.wl-marc.zyngier@arm.com> In-Reply-To: <86k1c9nrsa.wl-marc.zyngier@arm.com> From: Pavel Tatashin Date: Mon, 23 Sep 2019 15:13:11 -0400 Message-ID: Subject: Re: [PATCH 0/3] arm64: Allow early timestamping of kernel log To: Marc Zyngier Cc: Thomas Gleixner , John Stultz , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Will Deacon , Catalin Marinas , Mark Rutland , Linux ARM , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 23, 2019 at 3:17 AM Marc Zyngier wrote: > > 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. Hi Marc, I know we briefly discussed this at plumbers, but I want to bring it up again, because I am still puzzled why it is not possible to stabilize unstable clock early in boot. Here is an example where clock is stabilized: https://soleen.com/source/xref/linux/kernel/sched/clock.c?r=457c8996#265 It uses a value that is read at last ticks to normalize clock, and because ticks are not available early in boot instead we can make sure that early in boot sched_clock() never returns value smaller than previously returned value, and if we want to be extra careful, we can also make sure that sched_clock() early in boot does not jump ahead by more than some fixed amount of time i.e. more than one hour. If sched_clock() is available early we will get the benefit of having other tracers that use it to debug early boot information. Pasha