From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753172AbdLHTvt (ORCPT ); Fri, 8 Dec 2017 14:51:49 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:57574 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751213AbdLHTvs (ORCPT ); Fri, 8 Dec 2017 14:51:48 -0500 Date: Fri, 8 Dec 2017 20:51:36 +0100 (CET) From: Thomas Gleixner To: Petr Mladek cc: Prarit Bhargava , LKML , Linus Torvalds , Mark Salyzyn , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Andrew Morton , Sergey Senozhatsky , Steven Rostedt , Joe Perches Subject: Re: [RFC patch 7/7] timekeeping: Hack to use fine grained timestamps during boot In-Reply-To: <20171208112312.GB3148@linux.suse> Message-ID: References: <20171115181531.322572387@linutronix.de> <20171115182657.703928462@linutronix.de> <20171123125823.gnhwtnx6bxd3tb4q@pathway.suse.cz> <205229e2-fab4-31cb-60cd-f36bc2228804@redhat.com> <20171208112312.GB3148@linux.suse> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 8 Dec 2017, Petr Mladek wrote: > On Tue 2017-11-28 19:47:09, Thomas Gleixner wrote: > > On Tue, 28 Nov 2017, Prarit Bhargava wrote: > > > On 11/23/2017 07:58 AM, Petr Mladek wrote: > > > > On Wed 2017-11-15 19:15:38, Thomas Gleixner wrote: > > > >> For demonstration purposes only. > > > >> > > > >> Add a disgusting hack to work around the fact that high resolution clock > > > >> MONOTONIC accessors are not available during early boot and return stale > > > >> time stamps accross suspend/resume when the current clocksource is not > > > >> flagged with CLOCK_SOURCE_SUSPEND_ACCESS_OK. > > > >> > > > >> Use local_clock() to provide timestamps in early boot and when the > > > >> clocksource is not accessible after timekeeping_suspend(). In the > > > >> suspend/resume case this might cause non monotonic timestamps. > > > > > > > > I get the non-monotonic times even during boot: > > > > > > > > [ 0.026709] smp: Bringing up secondary CPUs ... > > > > [ 0.027973] x86: Booting SMP configuration: > > > > [ 0.028006] .... node #0, CPUs: #1 > > > > [ 0.004000] kvm-clock: cpu 1, msr 1:3ff51041, secondary cpu clock > > > > ^^^^^^^^ > > > > Which is interesting as this should happen even w/o those patches. > > Good point. I really see this even without those patches. > > I was confused because I saw the following with this patchset > but without this latest patch: > > [ 0.016000] smp: Bringing up secondary CPUs ... > [ 0.016000] x86: Booting SMP configuration: > [ 0.020000] .... node #0, CPUs: #1 > [ 0.020000] kvm-clock: cpu 1, msr 1:3ff52041, secondary cpu clock > [ 0.024000] KVM setup async PF for cpu 1 > [ 0.024000] kvm-stealtime: cpu 1, msr 13fc8d940 > > It is monotonic. The only drawback is that the resolution of the > monotonic clock is low at this stage. The kvm-clock printout probably happens before it is completely initialized. Thanks, tglx