From: "Dan Magenheimer" <dan.magenheimer@oracle.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: "Tian, Kevin" <kevin.tian@intel.com>,
"dan.magenheimer@oracle.com" <dan.magenheimer@oracle.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Dave Winchell <dwinchell@virtualiron.com>,
Ian Pratt <Ian.Pratt@eu.citrix.com>
Subject: RE: System time monotonicity
Date: Fri, 11 Apr 2008 16:05:32 -0600 [thread overview]
Message-ID: <20080411160532015.00000002992@djm-pc> (raw)
In-Reply-To: <C424C854.1632F%keir.fraser@eu.citrix.com>
> If we wanted to be more certain we could maintain a
> last_system_time fields per VCPU and
If you mean per VCPU *and* per guest this seems like
a good idea.
> backwards, by turning small backwards deltas into very short
> periods of stalled time.
The stalled time may be a problem, but only if the tsc skew
between processors is "bad". Your estimate of 100us seems
like it could be unacceptable for some applications.
Any idea how expensive arch/x86/time.c:local_time_calibration()
is? If it's not too bad, one option might be to add a xen
boot parameter "calibratehz" to calibrate more frequently.
Then systems running time-sensitive guests can be instructed
to increase the parameter accordingly to ensure tsc skew
is small enough.
> > If you are not confident that this will be OK on existing and
> > (within-reason) future Xen platforms, perhaps the hvm virtual
> > platform timers should (at least optionally) be built on physical
> > platform timers (Dave Winchell cc'ed), which would ensure time
> > never goes backwards.
>
> If we wanted to be more certain we could maintain a
> last_system_time fields
> per VCPU and, whenever using system time to compute current
> value for a
> virtual timer for an HVM VCPU, we could actually use max(system time,
> last_system_time). This would mean we were 100% sure that
> time didn't go
> backwards, by turning small backwards deltas into very short
> periods of
> stalled time.
>
> As it is: no, since system time 'free runs' on each CPU over
> one-second
> periods, there can be drift between CPUs if they are driven
> by different
> oscillators. Also there are tolerances in our software
> calibration code to
> consider. Which is why Linux guests implement the max(curr
> time, last time)
> in their gettimeofday() code. It would be quite reasonable to
> the same,
> inside Xen, for HVM guests. We can at least be pretty certain that any
> drifts across CPUs/VCPUs will be on the order of less than 100us.
>
> -- Keir
>
>
>
next prev parent reply other threads:[~2008-04-11 22:05 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-08 16:34 System time monotonicity Dan Magenheimer
2008-04-08 16:42 ` Keir Fraser
2008-04-08 17:39 ` Dan Magenheimer
2008-04-09 1:16 ` Tian, Kevin
2008-04-09 1:55 ` Dan Magenheimer
2008-04-09 3:20 ` Tian, Kevin
2008-04-09 12:42 ` Ian Pratt
2008-04-09 14:25 ` Dan Magenheimer
2008-04-09 14:41 ` Keir Fraser
2008-04-09 16:33 ` Dan Magenheimer
2008-04-09 16:40 ` Keir Fraser
2008-04-09 18:36 ` Dan Magenheimer
2008-04-10 7:08 ` Keir Fraser
2008-04-10 21:27 ` Dan Magenheimer
2008-04-11 6:48 ` Keir Fraser
2008-04-11 22:05 ` Dan Magenheimer [this message]
[not found] <47FFC37A.4060402@virtualiron.com>
2008-04-11 21:20 ` Keir Fraser
2008-04-11 21:41 ` Keir Fraser
2008-04-11 22:58 ` Dave Winchell
2008-04-12 7:09 ` Keir Fraser
2008-04-21 19:26 ` Dan Magenheimer
2008-04-21 19:31 ` Keir Fraser
2008-04-11 22:22 ` Dan Magenheimer
-- strict thread matches above, loose matches on Subject: below --
2007-04-03 17:51 Ian Pratt
2007-04-03 14:36 Ian Pratt
2007-04-03 14:57 ` John Levon
2007-03-26 18:23 John Levon
2007-03-26 18:47 ` Keir Fraser
2007-03-26 20:04 ` John Levon
2007-03-27 10:47 ` Keir Fraser
2007-04-03 14:03 ` John Levon
2007-03-26 18:50 ` Ian Pratt
2007-03-26 18:59 ` Keir Fraser
2007-03-26 20:14 ` John Levon
2007-03-26 21:55 ` Ian Pratt
2007-03-27 0:27 ` Keir Fraser
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=20080411160532015.00000002992@djm-pc \
--to=dan.magenheimer@oracle.com \
--cc=Ian.Pratt@eu.citrix.com \
--cc=dwinchell@virtualiron.com \
--cc=keir.fraser@eu.citrix.com \
--cc=kevin.tian@intel.com \
--cc=xen-devel@lists.xensource.com \
/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.