WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] System time monotonicity

On Mon, Mar 26, 2007 at 09:04:47PM +0100, John Levon wrote:

> > >> From what I can work out, time is supposed to be monotonic but I admit I
> > > can't really understand the time code yet at least. I couldn't find any
> > > documentation on what to expect from system time. Any suggestions?
> > > 
> > > This seems to happen across all the hardware we've tried but this
> > > particular case is a Sun V20Z with two CPUs:
> > > 
> > >   x86 (AuthenticAMD family 15 model 5 step 10 clock 2392 MHz)
> > >         AMD Opteron(tm) Processor 250
> > 
> > Small backwards time deltas are possible from the current time code. You'll
> > have to filter them out yourself if you can't deal with them. We could add
> > extra code in Xen to stop this happening for any individual VCPU
> 
> Some instrumentation indicated that we had cross-VCPU jitter of
> significant deltas, ~18us at worst. Though the instrumentation wasn't
> completely reliable so that might not be accurate.

I've done some more testing, the problem appears to be significantly
worse than you're claiming. I store the previously read value in the
thread structure and breakpoint whenever it fails:

[2]> fffffffece9e6040::print kthread_t t_dhrtime t_dhrtime_tsc t_dhrtime_cpu 
t_dhrtime_vers
t_dhrtime = 0x3de7923989c
t_dhrtime_tsc = 0x9414981ce0e
t_dhrtime_cpu = 0x2
t_dhrtime_vers = 0x2616

And the new values:
t_dhrtime = 0x3de7923088b
t_dhrtime_tsc = 0x9414982169b
t_dhrtime_cpu = 0x2
t_dhrtime_vers = 0x2618

[2]> 0x3de7923989c - 0x000003de7923088b=D
                36881

That's 36us. It doesn't even seem that we migrated across physical CPUs
given the version field. So something seems significantly awry to me?

(I must admit I still don't quite understand why monotonic_clock() is
called monotonic_clock() ...)

regards
john

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

<Prev in Thread] Current Thread [Next in Thread>