From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH] x86: adjust placement of pause insn in_raw_spin_lock() Date: Fri, 08 Aug 2008 15:12:10 +0100 Message-ID: <489C705A.76E4.0078.0@novell.com> References: <489C5CE1.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org That's the way it's done elsewhere and it's recommended (i.e. pause immediately preceding the memory reference of the possibly contended location). Jan >>> Keir Fraser 08.08.08 15:12 >>> Why? -- Keir On 8/8/08 13:49, "Jan Beulich" wrote: > Signed-off-by: Jan Beulich >=20 > Index: 2008-08-06/xen/include/asm-x86/spinlock.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- 2008-08-06.orig/xen/include/asm-x86/spinlock.h 2007-09-10 > 09:59:37.000000000 +0200 > +++ 2008-08-06/xen/include/asm-x86/spinlock.h 2008-08-07 12:36:13.0000000= 00 > +0200 > @@ -23,8 +23,8 @@ static inline void _raw_spin_lock(spinlo > "1: lock; decb %0 \n" > " js 2f \n" > ".section .text.lock,\"ax\"\n" > - "2: cmpb $0,%0 \n" > - " rep; nop \n" > + "2: rep; nop \n" > + " cmpb $0,%0 \n" > " jle 2b \n" > " jmp 1b \n" > ".previous" >=20 >=20 >=20 >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com=20 > http://lists.xensource.com/xen-devel=20