All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dan Magenheimer" <dan.magenheimer@oracle.com>
To: John Levon <levon@movementarian.org>
Cc: Ian Pratt <Ian.Pratt@eu.citrix.com>,
	"Xen-Devel (E-mail)" <xen-devel@lists.xensource.com>,
	Dave Winchell <dwinchell@virtualiron.com>,
	Keir Fraser <keir.fraser@eu.citrix.com>
Subject: RE: RE: [PATCH] rendezvous-based local time calibration WOW!
Date: Wed, 6 Aug 2008 07:25:50 -0600	[thread overview]
Message-ID: <20080806072550375.00000008444@djm-pc> (raw)
In-Reply-To: <20080805211251.GA27007@totally.trollied.org.uk>

> > I'm not sure its possible to guarantee monotonicity in
> > PV domains (without a global lock) except by doing a trap
> > or hypercall at each "get time".
> 
> That's a shame.

Further followup on this...

I'd encourage you to put some test code in your lock to
see if time ever measurably goes backwards.  It may never,
or it may only on some ill-behaved-tsc machines or when
cpufreq changes occur... needs testing.  Even if it
does, it may be by a smaller delta than all but the
most sophisticated SMP applications can detect.
Why?...

On my (admittedly well-behaved-tsc) machine, I've now
run a quarter-million samples on the new code.  The
"xm debug-key t" code now prints out both stime skew
and tsc. The results (TSC scaled for easier reading):

stime: max 349ns avg 114ns
TSC:   max 342ns avg  89ns

This is a dual-core Conroe so the TSC is supposedly
synchronized; so the differences are probably more due
to inter-CPU cache synchronization in the measurement code
than actual skew.

My currently running test code also records distribution
for stime skew. 99% of the samples are less than 200ns,
0.9% are 200ns-300ns, and 0.01% are greater than 300ns
(and less than the max of 349ns).   This compares to the
previous algorithm in which I measured ~2% greater than
1us and a few greater than 10us.  The old code was also
sensitive to load, with average skew increasing when
domains were busy.  The new code should be insensitive
to load.

So still no guarantees, but I do think this qualifies
as "greatly improved" and may also meet your needs.

  parent reply	other threads:[~2008-08-06 13:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-03 16:50 [PATCH] rendezvous-based local time calibration WOW! Dan Magenheimer
2008-08-03 17:24 ` Keir Fraser
2008-08-04 15:24   ` Dan Magenheimer
2008-08-04 15:36     ` Keir Fraser
2008-08-04 17:10     ` Keir Fraser
2008-08-04 17:37       ` Dan Magenheimer
2008-08-04 19:40         ` Dan Magenheimer
2008-08-04 19:47           ` Keir Fraser
2008-08-05 18:56           ` John Levon
2008-08-05 20:49             ` Dan Magenheimer
2008-08-05 21:12               ` John Levon
2008-08-05 21:27                 ` Dan Magenheimer
2008-08-05 21:43                   ` Keir Fraser
2008-08-06 13:25                 ` Dan Magenheimer [this message]
2008-08-06 13:38                   ` John Levon
2008-08-06 15:09                     ` Dan Magenheimer
2008-08-06 15:21                       ` John Levon
2008-08-06 15:34                         ` Dan Magenheimer
2008-08-09 14:47                         ` Nils Nieuwejaar
2008-08-09 20:55                           ` Dan Magenheimer
2008-08-11 14:37                             ` John Levon
2008-08-11 14:38                               ` Keir Fraser
2008-08-11 14:43                                 ` John Levon
2008-08-11 14:46                                   ` Keir Fraser
2008-08-11 14:49                                     ` John Levon
2008-08-11 14:50                                       ` Keir Fraser
2008-08-11 18:41                                         ` John Levon

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=20080806072550375.00000008444@djm-pc \
    --to=dan.magenheimer@oracle.com \
    --cc=Ian.Pratt@eu.citrix.com \
    --cc=dwinchell@virtualiron.com \
    --cc=keir.fraser@eu.citrix.com \
    --cc=levon@movementarian.org \
    --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.