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/
Home Products Support Community News


RE: [Xen-devel] [PATCH] time-xen : Reset monotonic time when sync up tim

To: Darryl Veitch <dveitch@xxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] time-xen : Reset monotonic time when sync up time from dom0 to domU
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Mon, 18 Oct 2010 07:52:03 -0700 (PDT)
Cc: Jeremy Fitzhardinge <jeremy@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Keir Fraser <keir@xxxxxxx>, Tim Deegan <Tim.Deegan@xxxxxxxxxx>, Shunli Yi <syi@xxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>, Saipu Liu <saliu@xxxxxxxxxxxx>, Hang Du <hdu@xxxxxxxxxxxx>, Timothy Broomhead <tim@xxxxxxxxxxxxxxx>, Julien Ridoux <jridoux@xxxxxxxxxxxxxx>
Delivery-date: Mon, 18 Oct 2010 07:55:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <43468AF5-4D81-47E9-A6F7-2D8A25A432FD@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <9C56B6AEEB2D60488B29B880DF7E53BE03C1B2C6B6@xxxxxxxxxxxxxxxxxxxxx> <4CB4672E020000780001C752@xxxxxxxxxxxxxxxxxx> <0b6cc1b3-f838-482e-89dc-6f19cc8c47cc@default> <20101013161657.GJ4007@xxxxxxxxxxxxxxxxxxxxxxx> <20101015141959.GN4007@xxxxxxxxxxxxxxxxxxxxxxx> <c049c7f4-3db4-4552-9c70-80f0a7a440e5@default 43468AF5-4D81-47E9-A6F7-2D8A25A432FD@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

Hi Darryl –


So how would a userland enterprise app go about doing this?

For example, the Oracle DB (and other Oracle enterprise apps) collects timestamps at a high frequency, sometimes more than 10K timestamps/second.  (These are used primarily for collecting transaction statistics, but these statistics are collected by default and must be explicitly disabled by a DB administrator.)   As one might expect, the difference between any two of these timestamps is the key result and the two timestamps may differ by seconds or minutes so, as  a result, the two timestamps of interest may cross a live migration boundary.


I am guessing that to use the approach you suggest, both the counter and some form of “generation indicator” must be stored for each timestamp, then when the difference between the two is to be calculated, the RADclock history is consulted, essentially to lookup, if they are different, the two generation indicators and use them to adjust the two counters.


Ideally, this would be entirely hidden from userland in the kernel, but the cost of a “real” system call is too high to be incurred 10K/sec, and I’m not sure how RADclock history could be consulted in a vsyscall.





P.S. Since you probably don’t closely follow the xen-devel list, some discussion has occurred on other threads without cc’ing you.  If you are interested, search for RADclock in xen.markmail.org.


From: Darryl Veitch [mailto:dveitch@xxxxxxxxxxxxxx]
Sent: Friday, October 15, 2010 4:57 PM
To: Dan Magenheimer
Cc: Tim Deegan; Jeremy Fitzhardinge; Jan Beulich; Hang Du; Keir Fraser; Saipu Liu; Shunli Yi; xen-devel@xxxxxxxxxxxxxxxxxxx; Julien Ridoux; Timothy Broomhead
Subject: Re: [Xen-devel] [PATCH] time-xen : Reset monotonic time when sync up time from dom0 to domU


Hi All,


in terms of pounding on xenstore, one way to get around this is to note that raw timestamps (that is what we call counter readings) can be taken at the required events but only converted to walltime later. This could be done in batches asynchronously, and perhaps even much later off-line, depending on the application.  This is one of the advantages of the feedforward approach. The RADclock keeps historical data which enables raw timestamps to be converted to walltime at any time with identically zero loss of precision- they would be exactly the same wallclock values as if they were calculated immediately.





On 15/10/2010, at 4:53 PM, Dan Magenheimer wrote:

(RADclock authors cc'ed in attempt to re-merge the two threads...
Tim, if it's not too late, please reply to this email rather
than the previous one without the full cc list)

From: Dan Magenheimer

Sent: Friday, October 15, 2010 8:47 AM

To: Tim Deegan

Cc: Jeremy Fitzhardinge; Jan Beulich; Hang Du; Keir Fraser; Saipu Liu;

Shunli Yi; xen-devel@xxxxxxxxxxxxxxxxxxx

Subject: RE: [Xen-devel] [PATCH] time-xen : Reset monotonic time when

sync up time from dom0 to domU


Also, for those certain enterprise applications that want

to sample time 10000+ samples/second/processor, and need

to know "immediately" when a sample might be bad (due

to, for example, live migration), I think each sample would

need to check xenstore.  Is xenstore up to that kind of

pounding (and is it fast enough)?


No it's certainly not (either of those things), but:

- the problem of turning a distributed wallclock into something


  for timestamping that aggressively is orthogonal to the problem of

  distributing that wallclock in the first place; and


Agreed that this is a better solution to a very important problem.

I'm just trying to determine if it helps solve another time-related

real world problem.


- all the user really needs is a generation counter to know that the

  clock correction values are stale, and the kernel can provide that

  alongside the stime.


Agreed that a generation counter solves this.  BUT...


(1) afaik there is no generation counter in any time-related

kernel API; and


(2) afaict this generation counter would need to be "pushed"

from the dom0 kernel so would either (a) require domU kernels

to read from xenstore, or (b) require some kind of privileged

hypercall from dom0 to the hypervisor telling the hypervisor

to change the generation counter (and scaling values?) for all




Darryl Veitch

Sabbatical Address:


23 Avenue D'Italie

75214 Paris Cedex 13, France 

Tel:  +33 (0)1 39 63 55 40


Technicolor Paris Research Lab

1, rue Jeanne d'Arc

92443 Issy-les-Moulineaux Cedex, France

Tel:  +33 (0)1 41 86 52 19



dveitch AT unimelb edu au

AIM id:  darrylveitch

Skype:  darrylveitch








Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>