From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, Radim Krcmar <rkrcmar@redhat.com>
Subject: Re: [patch 1/2] KVM: x86: switch KVMCLOCK base to CLOCK_MONOTONIC_RAW
Date: Wed, 23 Oct 2019 12:44:25 -0200 [thread overview]
Message-ID: <20191023144422.GA27674@amt.cnet> (raw)
In-Reply-To: <20180813125252.GA31066@amt.cnet>
On Mon, Aug 13, 2018 at 09:52:55AM -0300, Marcelo Tosatti wrote:
> On Fri, Aug 10, 2018 at 09:15:51AM +0200, Paolo Bonzini wrote:
> > On 09/08/2018 16:52, Marcelo Tosatti wrote:
> > > Commit 0bc48bea36d1 ("KVM: x86: update master clock before computing kvmclock_offset")
> > > switches the order of operations to avoid the conversion
> > >
> > > TSC (without frequency correction) ->
> > > system_timestamp (with frequency correction),
> > >
> > > which might cause a time jump.
> > >
> > > However, it leaves any other masterclock update unsafe, which includes,
> > > at the moment:
> > >
> > > * HV_X64_MSR_REFERENCE_TSC MSR write.
> > > * TSC writes.
> > > * Host suspend/resume.
> > >
> > > Avoid the time jump issue by using frequency uncorrected
> > > CLOCK_MONOTONIC_RAW clock.
> > >
> > > Its the guests time keeping software responsability
> > > to track and correct a reference clock such as UTC.
> > >
> > > Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
> >
> > What happens across migration?
> >
> > Paolo
>
> You mean between
>
> frequency corrected host -> frequency uncorrected host
>
> And vice-versa?
>
> I'll check NTP's/Chrony's behaviour and let you know.
>
> Thanks
They will measure and adjust their frequency corrections
(which is necessary anyway due to temperature variations
for example).
http://doc.ntp.org/4.1.0/ntpd.htm
Frequency Discipline
The ntpd behavior at startup depends on whether the frequency file,
usually ntp.drift, exists. This file contains the latest estimate of
clock frequency error. When the ntpd is started and the file does not
exist, the ntpd enters a special mode designed to quickly adapt to the
particular system clock oscillator time and frequency error. This takes
approximately 15 minutes, after which the time and frequency are set to
nominal values and the ntpd enters normal mode, where the time and
frequency are continuously tracked relative to the server. After one
hour the frequency file is created and the current frequency offset
written to it. When the ntpd is started and the file does exist, the
ntpd frequency is initialized from the file and enters normal mode
immediately. After that the current frequency offset is written to the
file at hourly intervals.
parent reply other threads:[~2019-10-23 14:44 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20180813125252.GA31066@amt.cnet>]
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=20191023144422.GA27674@amt.cnet \
--to=mtosatti@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
/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