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: [PATCH] Fix memory order issue inside pv spinlock

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] Fix memory order issue inside pv spinlock
From: "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx>
Date: Thu, 10 Sep 2009 09:41:11 +0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 09 Sep 2009 18:41:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4AA7FBB5.3000204@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: <4AA4B8FF.9070905@xxxxxxxxx> <4AA6D3CF.70905@xxxxxxxx> <4AA7D808.6010108@xxxxxxxxx> <4AA7FBB5.3000204@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090817)
Jeremy Fitzhardinge wrote:

On 09/09/09 09:30, Yang, Xiaowei wrote:
Jeremy Fitzhardinge wrote:
On 09/07/09 00:40, Yang, Xiaowei wrote:
barrier() can't prevent reads after it not being reordered with older
writes to different locates before it. Because of it, I can't bring up
4 HVM guests on one SMP machine. Use mb() instead.
Which read is happening too early?  Is it "xl->spinners"?  How does
it fail?
Yes. If read of xl->spinners happens earlier than write 0 to xl->lock,
notifications to wake up other spinners can be omitted incorrectly,
resulting in others polling indefinitely (because of poll evtchn not
pending) with the lock is uncontended.

OK.  And the CPU only guarantees that, without explicit barriers,
write-read ordering is only maintained between accesses to the same
memory location, not separate locations?


Exactly! For more details please refer to Chapter 8.2 of Intel SDM 3A.

Thanks,
Xiaowei

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