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

Re: [Xen-devel] Xen domU Timekeeping



Mr Qrux, please do not cross post. I have moved xen-devel to BCC since
the bit I'm replying too seems more appropriate to the xen-users list.

On Tue, 2012-02-14 at 15:57 +0000, Konrad Rzeszutek Wilk wrote:
> On Mon, Feb 13, 2012 at 06:18:07PM -0800, Qrux wrote:
> > Howdy, all.
> > 
> > Is there definitive documentation about accurate timekeeping on Linux PV 
> > domUs (Xen-4.1.2, Linux-3.1-pvops)?
> > 
> > Specifically:
> > 
> >     * Is there a way to keep good time (i.e., bare-metal accuracy) on domU?
> 
> It does that now. It uses the same clock as the hypervisor does so there
> is no "lost ticks" or such.
> 
> > 
> >     * What's happened to /proc/sys/xen/independent_wallclock?
> 
> No idea. What did that do?

There was a feature of the classic-Xen Linux kernels called dependent
wallclock (it was the default for those kernels). In this mode each call
to gettimeofday would return the time direct from the wallclock time
provided by the hypervisor in the shared info (wc_*). This means that
guest userspace would always get the wallclock time from the hypervisor.
dom0 would keep the hypervisor up to date by running ntp and pushing the
results down and therefore keep all guests in sync automatically.

Setting independent_wallclock would configure a guest to not use the
shared wallclock time but instead to grab the time once from the shared
info at boot and thereafter maintain its own idea of time based on its
timer ticks. This is analogous to how things happen on native (i.e. read
the RTC on boot and then user the ticks to keep in sync).

A pvops kernel has no concept of dependent_wallclock and is effectively
always in independent_wallclock mode. Jeremy made this call IIRC because
it matches how native works which reduces the special casing needed for
VMs.

This does however mean that you need to run NTP in a guest which runs a
pvops kernel.

> > 
> >     * Does NTP on domU "work"?  Does adjtimex do anything?

For the reasons above running NTP is highly recommended in any domain
running a pvops kernel.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.