From: Marcelo Tosatti <mtosatti@redhat.com>
To: Aritoki TAKADA <aritoki.takada.jt@hitachi.com>
Cc: kvm@vger.kernel.org, ltc-kernel@ml.yrl.intra.hitachi.co.jp
Subject: Re: Question: Timekeeping between Host and Guest with NTP
Date: Fri, 24 Aug 2012 12:00:30 -0300 [thread overview]
Message-ID: <20120824150030.GD13206@amt.cnet> (raw)
In-Reply-To: <503768F5.1000109@hitachi.com>
On Fri, Aug 24, 2012 at 08:43:49PM +0900, Aritoki TAKADA wrote:
> Thank you for your comment,
>
> (2012/08/24 3:13), Marcelo Tosatti wrote:
> <snip>
> >NTP should be running in the guest so as to synchronize the guest
> >time-of-day clocks to UTC.
> >
> >kvmclock exposes the monotonic clock from the host. The frequency
> >of the host monotonic clock is corrected by host ntpd. This is
> >probably where the confusion comes from.
> >
> >That is no guarantee that time-of-day clocks in the guest are
> >synchronized to UTC or even that clock frequency visible to userspace
> >applications in the guest is equal to the monotonic clock frequency
> >of the host.
>
> I understood your comment except one point.
> We know that the frequency of host monotonic clock is kept
> accurate by host ntpd and that kvmclock shows it to the guest.
> Doesn't this mean that applications in the guest can see the accurate
> clock frequency provided by the host?
kvmclock driver has access to the ntpd corrected frequency of the host, but:
1) kvmclock time as reported to the guest uses the TSC as an offset in
addition to the host monotonic clock, TSC is susceptible to frequency
variations.
The guest has its own timekeeping (it accumulates time from kvmclock,
at every timer interrupt). The algorithm is not
perfect, and its suspectible to small variations.
These add up over time.
2) Corrections to UTC, such as leap seconds, are not reflected to the
host monotonic clock. NTP algorithm in the guest is responsible for
synchronization to UTC.
next prev parent reply other threads:[~2012-08-24 15:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 8:46 Question: Timekeeping between Host and Guest with NTP Aritoki TAKADA
2012-08-23 18:13 ` Marcelo Tosatti
2012-08-24 11:43 ` Aritoki TAKADA
2012-08-24 15:00 ` Marcelo Tosatti [this message]
2012-08-27 9:37 ` Aritoki TAKADA
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=20120824150030.GD13206@amt.cnet \
--to=mtosatti@redhat.com \
--cc=aritoki.takada.jt@hitachi.com \
--cc=kvm@vger.kernel.org \
--cc=ltc-kernel@ml.yrl.intra.hitachi.co.jp \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.