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

[Xen-devel] Re: Linux questions

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] Re: Linux questions
From: Andi Kleen <andi@xxxxxxxxxxxxxx>
Date: Tue, 4 Dec 2007 12:44:05 +0100
Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxxxx>, Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Delivery-date: Thu, 06 Dec 2007 08:33:44 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C37AEA06.195C2%Keir.Fraser@xxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <p73r6i2k90a.fsf@xxxxxxxxxxxxxx> <C37AEA06.195C2%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
On Tue, Dec 04, 2007 at 11:27:02AM +0000, Keir Fraser wrote:
> On 4/12/07 11:13, "Andi Kleen" <andi@xxxxxxxxxxxxxx> wrote:
> 
> >>> I have to disagree: At least the uses of barrier() in monotonic_clock()
> >>> appear
> >>> to be in places where in reality (and from a theoretical standpoint) rmb()
> >>> ought to be used.
> >> 
> >> We're sync'ing against concurrent updates of a this_cpu variable. We can
> >> only race updates in a local ISR, and hence barrier() suffices.
> > 
> > Not if you use RDTSC inside the loop.
> 
> I must disagree! And I *know* that RDTSC is not a serialising instruction...
> 
> If we race, then there was an interrupt. Interrupt delivery is a
> serialisation point for the interrupted instruction stream.

The synchronization relies on the RDTSC happening between the 
two sequence number checks. Otherwise you can get inconsistent state
between RDTSC and the xtime data which might be changing asynchronously 
on another CPU. Therefore you need RDTSC barriers.

-Andi

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