x86: adjust placement of pause insn in _raw_spin_lock()
PATCH 1/1 x86: adjust placement of pause insn in _raw_spin_lock()
xen/include/asm-x86/spinlock.h +2 -2
@@ -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"
Why?
-- Keir
Quoted 27 lines · Jan Beulich
Signed-off-by Jan Beulich <[email protected]>Index:
2008-08-06/xen/include/asm-x86/spinlock.h
===================================================================
---2008-08-06.orig/xen/include/asm-x86/spinlock.h2007-09-10 09:59:37.000000000 +0200
+++2008-08-06/xen/include/asm-x86/spinlock.h2008-08-07 12:36:13.000000000 +0200xen/include/asm-x86/spinlock.h +2
-2@@ -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" _______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Ah, I suppose it reduce lock acquisition latency slightly. I'll apply it.
-- Keir
Quoted 33 lines · Keir Fraser
Why?
-- Keir
Quoted 27 lines · Jan Beulich
Signed-off-by Jan Beulich <[email protected]>Index:
2008-08-06/xen/include/asm-x86/spinlock.h
===================================================================
---2008-08-06.orig/xen/include/asm-x86/spinlock.h2007-09-10 09:59:37.000000000 +0200
+++2008-08-06/xen/include/asm-x86/spinlock.h2008-08-07 12:36:13.000000000 +0200xen/include/asm-x86/spinlock.h +2
-2@@ -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" _______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Re: [PATCH] x86: adjust placement of pause insn in_raw_spin_lock()
In reply to Keir FraserThat'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
Quoted 1 line
Quoted 1 line
Quoted 1 line
Keir Fraser <[email protected]> 08.08.08 15:12 >>>
Why?
-- Keir
Quoted 27 lines · Jan Beulich
Signed-off-by Jan Beulich <[email protected]>Index:
2008-08-06/xen/include/asm-x86/spinlock.h
===================================================================
---2008-08-06.orig/xen/include/asm-x86/spinlock.h2007-09-10 09:59:37.000000000 +0200
+++2008-08-06/xen/include/asm-x86/spinlock.h2008-08-07 12:36:13.000000000 +0200xen/include/asm-x86/spinlock.h +2
-2@@ -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" _______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel