From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH] Fix memory order issue inside pv spinlock Date: Tue, 08 Sep 2009 14:59:43 -0700 Message-ID: <4AA6D3CF.70905@goop.org> References: <4AA4B8FF.9070905@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4AA4B8FF.9070905@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Yang, Xiaowei" Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org 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? Thanks, J > > Signed-off-by: Yang Xiaowei > > diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c > index 5601506..9dee5f8 100644 > --- a/arch/x86/xen/spinlock.c > +++ b/arch/x86/xen/spinlock.c > @@ -324,7 +325,7 @@ static void xen_spin_unlock(struct raw_spinlock > *lock) > xl->lock = 0; /* release lock */ > > /* make sure unlock happens before kick */ > - barrier(); > + mb(); > > if (unlikely(xl->spinners)) > xen_spin_unlock_slow(xl); > > Thanks, > Xiaowei >