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] Is there a way to get consistant time across different V

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: Re: [Xen-devel] Is there a way to get consistant time across different VMs?
From: walmart <vmwalmart@xxxxxxxxx>
Date: Tue, 7 Sep 2010 19:31:16 -0700
Cc: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 07 Sep 2010 19:36:11 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=b/ToLkgZ4lDdeKdG0rgsBkidIz0gOkSksZKta6mhO1c=; b=v6Yrm/MRqEvJxxfoR4qhrqMwn8ELUiTu11LravWZik8zsnbs40hTM3Du2OI7l8DOQl HaAd7g/Cdotpdd3m5JtvKj72OddGA/JS/0KSI5R18HhuDX7GYRd8Q65ZTdMGNqilXhLm epBZ9IBdeNr7OWSRwPSsVC08qX0kS542wcnRk=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=oArlcyKAZd6YLqEA+FG3zhOn6EhE8zw5/fsGGCKOh/NagSwQKSdonlX2Qrl0/Ll3GS nXwIZZ4u32awbf+ToIemsDiDvY0dSRT7+DpqLfN8pwkhczBpmUMvxFPBP1VMpOf+cgvW eN2W28jQSoAzU0Lf22a7qMhRDsHuIH+BR8Uxc=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4C85F390.7070205@xxxxxxxx>
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: <AANLkTimn-67fkWaUno3m+Ndw=+Qm=FwcrYCRmoNNwx4U@xxxxxxxxxxxxxx> <4C85F390.7070205@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, Jeremy:

Thanks for the reply.

I have pinned two VMs on the same core (1 VCPU per VM), but the rdtsc
reading from them are different. What I want are monotonicity,
accuracy, and low cost.

I think I'll try to turn on rdtsc emulation.I found this on the web:

I'll try that.

thanks very much!



On Tue, Sep 7, 2010 at 3:10 AM, Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:
>  On 09/07/2010 02:12 PM, walmart wrote:
>> Hi, all:
>> I want to test some program, which requires a high precise time. (some
>> thing as rdtsc).
>> I tested rdtsc on different VMs, they are not consistant. (I am using
>> Xen 4.0, Fedora 13, 64 bit).
>> Is there a way to get consistant high precise time across different VMs?
> Hm, you're walking into a bit of a minefield.
> What are your precise requirements for:
>    * accuracy
>    * resolution
>    * monotonicity
>    * cross-cpu synchronization
>    * cross-process synchronization
> ?
> In general rdtsc isn't very useful as a timesource, since there are many
> ways in which it can fail/do strange things from processor to processor
> and system to system, so "s[a]me thing as rdtsc" doesn't tell us much.
> However, in modern versions of Xen, you can turn on rdtsc emulation
> which makes rdtsc generate a guaranteed global monotonic time value at a
> nominal 1GHz rate (I think, or did that change to the starting CPU
> speed?).  But the downside is that it results in a trap'n'emulate of the
> instruction which is a bit more expensive than a raw rdtsc.
> Or if you have a new Intel system with a really, truly nonstop
> synchronized tsc, you can use rdtsc directly.
> But if neither of those are acceptable/possible, you need to use the
> normal Xen system time, which has a 1ns resolution, is fairly precise,
> but not generally completely monotonic between cpus.  It also isn't
> usable from usermode without some extra kernel patches.
>    J

Xen-devel mailing list

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