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 15:32:09 -0800 [thread overview]
Message-ID: <45F33FF9.70406@goop.org> (raw)
In-Reply-To: <1173568491.24738.1194.camel@localhost.localdomain>
Thomas Gleixner wrote:
> The clocksource is not used until the clocksource is installed. Also the
> periodic mode during boot, when the clock event device supports periodic
> mode, is not reading the time. It relies on the clock event device
> getting it straight.
Yes. This could be one source of error, where I compute the offset
hypervisor_time - ktime_get(), but ktime_get() may drift with respect to
hypervisor time while using a periodic jiffies timebase.
> Once we switch to NO_HZ or HIGHRES the clock event device is directly
> coupled to the clock event source.
>
OK. Erm, but not in the sense that you always choose the xen/hpet/lapic
clocksource+clockevent together; there's no direct linkage between the
two kinds of device. But there's the coupling where the clocksource is
always used to directly measure the clockevent's behaviour.
> Once we switched over to the clocksource, everything should be in
> perfect sync.
>
Assuming that the clocksource and the clockevent device have
close-enough timebases.
>> Or perhaps this is a property of the whole clock subsystem: that
>> clockevents must be paired with clocksources. But its not obvious to me
>> that this enforced, or even acknowledged.
>>
>
> 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.
>
Right, but if the clocksource and the clockevent devices have a relative
drift, then using the clocksource to compute that we need a 500ns delay,
but the clockevent device ends delivering the oneshot event 750ns (or
250ns) later, then things are going to be locally upset, even if the
next time the clockevent oneshot is programmed it will take the
overshoot into account. (Of course, you'd hope the drift would never
really be that bad, and 2^32 ns only gives you ~4s window to screw up).
> What problem are you observing ?
>
Unexpected pauses during boot. I think the real problem is that Xen
periodic timer events are not delivered unless the vcpu is actually
running (ie, they're specifically intended for timeslicing rather than
general periodic events). Perhaps the real fix in this case is to just
remove the periodic feature flag.
J
next prev parent reply other threads:[~2007-03-10 23:32 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 [this message]
2007-03-11 0:42 ` Jeremy Fitzhardinge
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=45F33FF9.70406@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