Re: Question: Timekeeping between Host and Guest with NTP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux