qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Salvatore Bonaccorso <carnil@debian.org>
To: Steven Sistare <steven.sistare@oracle.com>
Cc: Dominique Martinet <asmadeus@codewreck.org>,
	Pavel Tatashin <pavel.tatashin@microsoft.com>,
	daniel.m.jordan@oracle.com, linux@armlinux.org.uk,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	john.stultz@linaro.org, sboyd@codeaurora.org, x86@kernel.org,
	linux-kernel@vger.kernel.org, mingo@redhat.com,
	tglx@linutronix.de, hpa@zytor.com, douly.fnst@cn.fujitsu.com,
	peterz@infradead.org, prarit@redhat.com, feng.tang@intel.com,
	pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk,
	linux-s390@vger.kernel.org, boris.ostrovsky@oracle.com,
	jgross@suse.com, pbonzini@redhat.com,
	virtualization@lists.linux-foundation.org, kvm@vger.kernel.org,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v15 23/26] sched: early boot clock
Date: Wed, 2 Jan 2019 21:20:32 +0100	[thread overview]
Message-ID: <20190102202032.GA1034@eldamar.local> (raw)
In-Reply-To: <95c3920e-bf80-0c7e-7854-01a1c3189c23@oracle.com>

Hi,

On Tue, Nov 06, 2018 at 06:35:36AM -0500, Steven Sistare wrote:
> Pavel has a new email address, cc'd - steve
> 
> On 11/6/2018 12:42 AM, Dominique Martinet wrote:
> > (added various kvm/virtualization lists in Cc as well as qemu as I don't
> > know who's "wrong" here)
> > 
> > Pavel Tatashin wrote on Thu, Jul 19, 2018:
> >> Allow sched_clock() to be used before schec_clock_init() is called.
> >> This provides with a way to get early boot timestamps on machines with
> >> unstable clocks.
> > 
> > This isn't something I understand, but bisect tells me this patch
> > (landed as 857baa87b64 ("sched/clock: Enable sched clock early")) makes
> > a VM running with kvmclock take a step in uptime/printk timer early in
> > boot sequence as illustrated below. The step seems to be related to the
> > amount of time the host was suspended while qemu was running before the
> > reboot.
> > 
> > $ dmesg
> > ...
> > [    0.000000] SMBIOS 2.8 present.
> > [    0.000000] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20180724_192412-buildhw-07.phx2.fedoraproject.org-1.fc29 04/01/2014
> > [    0.000000] Hypervisor detected: KVM
> > [    0.000000] kvm-clock: Using msrs 4b564d01 and 4b564d00
> > [283120.529821] kvm-clock: cpu 0, msr 321a8001, primary cpu clock
> > [283120.529822] clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
> > [283120.529824] tsc: Detected 2592.000 MHz processor
> > ...
> > 
> > (The VM is x86_64 on x86_64, I can provide my .config on request but
> > don't think it's related)
> > 
> > 
> > It's rather annoying for me as I often reboot VMs and rely on the
> > 'uptime' command to check if I did just reboot or not as I have the
> > attention span of a goldfish; I'd rather not have to find something else
> > to check if I did just reboot or not.
> > 
> > Note that if the qemu process is restarted, there is no offset anymore.
> > 
> > I unfortunately just did that so cannot say with confidence (putting my
> > laptop to sleep for 30s only led to a 2s offset and I do not want to
> > wait longer right now), but it looks like the clock is still mostly
> > correct after reboot after disabling my VM's ntp client. Will infirm
> > that tomorrow if I was wrong.
> > 
> > 
> > Happy to try to help fixing this in any way, as written above the quote
> > I'm not even actually sure who is wrong here.

A user in Debian reported the same/similar issue (with 4.19.13):

https://bugs.debian.org/918036

Regards,
Salvatore

  reply	other threads:[~2019-01-02 20:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180719205545.16512-1-pasha.tatashin@oracle.com>
     [not found] ` <20180719205545.16512-24-pasha.tatashin@oracle.com>
2018-11-06  5:42   ` [Qemu-devel] [PATCH v15 23/26] sched: early boot clock Dominique Martinet
2018-11-06 11:35     ` Steven Sistare
2019-01-02 20:20       ` Salvatore Bonaccorso [this message]
2019-01-03 21:28         ` Pavel Tatashin
2019-01-03 23:43           ` Dominique Martinet
2019-01-07 18:17             ` Pavel Tatashin
2019-01-07 23:48               ` Dominique Martinet
2019-01-08  1:04                 ` Pavel Tatashin
2019-01-08  1:09                   ` Dominique Martinet
2019-01-26  2:04                   ` Jon DeVree
2019-01-26 16:11                     ` Pavel Tatashin
2019-01-04  7:30           ` [Qemu-devel] [PATCH v15 23/26] sched: early boot clock (was Re: Bug#918036: linux: uptime after reboot wrong (kvm-clock related?)) Thorsten Glaser
     [not found] <154644530361.2390.18185252504260044930.reportbug@ci-busyapps.lan.tarent.de>
     [not found] ` <20190102163939.GB13145@eldamar.local>

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190102202032.GA1034@eldamar.local \
    --to=carnil@debian.org \
    --cc=asmadeus@codewreck.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=daniel.m.jordan@oracle.com \
    --cc=douly.fnst@cn.fujitsu.com \
    --cc=feng.tang@intel.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=john.stultz@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@redhat.com \
    --cc=pavel.tatashin@microsoft.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=prarit@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sboyd@codeaurora.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=steven.sistare@oracle.com \
    --cc=tglx@linutronix.de \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).