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: "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] Fix memory order issue inside pv spinlock
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Tue, 08 Sep 2009 14:59:43 -0700
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 08 Sep 2009 15:00:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4AA4B8FF.9070905@xxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3
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 <xiaowei.yang@xxxxxxxxx>
>
> 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
>


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