From: Jeremy Fitzhardinge <jeremy@goop.org>
To: tglx@linutronix.de
Cc: Dan Hecht <dhecht@vmware.com>, john stultz <johnstul@us.ibm.com>,
Virtualization Mailing List <virtualization@lists.osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Use of absolute timeouts for oneshot timers
Date: Sat, 10 Mar 2007 16:42:48 -0800 [thread overview]
Message-ID: <45F35088.7020607@goop.org> (raw)
In-Reply-To: <1173568491.24738.1194.camel@localhost.localdomain>
Thomas Gleixner wrote:
> It's simply enforced in NO_HZ, HIGHRES mode as we operate in absolute
> time, which is read back from the clocksource, even if we use a relative
> value for real hardware clock event devices to program the next event.
> We calculate the delta between the absolute event and now. So we never
> get an accumulating error.
>
> What problem are you observing ?
Actually, two things. There was the unexpected pauses during boot,
which is trivially fixable by not using the Xen periodic timer, and
using the single-shot fallback.
But I'm making the more general observation that if you use an absolute
rather than relative time to set the single-shot timeout, then you have
to deal with a long-term cumulative drift between the kernel's monotonic
time and the hypervisor's monotonic time. This can happen even if your
clocksource is derived directly from the hypervisor monotonic time,
because running ntp will warp the kernel's time, and so it will drift
with respect to the hypervisor clock. You can only avoid this by 1) not
allowing adjtime, or 2) making those same adjtime warps to the
hypervisor time. Neither of these is a good general solution.
Therefore, the only useful way to set a single-shot timer is by using
relative rather than absolute time, and making sure the delta not too
large. The guest and hypervisor may (and in general, will) have
drifting clocks, but the error will never be too large to deal with.
J
next prev parent reply other threads:[~2007-03-11 0:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-10 22:52 Use of absolute timeouts for oneshot timers Jeremy Fitzhardinge
2007-03-10 23:14 ` Thomas Gleixner
2007-03-10 23:32 ` Jeremy Fitzhardinge
2007-03-11 0:42 ` Jeremy Fitzhardinge [this message]
2007-03-11 9:21 ` Thomas Gleixner
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=45F35088.7020607@goop.org \
--to=jeremy@goop.org \
--cc=dhecht@vmware.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=virtualization@lists.osdl.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