All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: adjust placement of pause insn in _raw_spin_lock()
@ 2008-08-08 12:49 Jan Beulich
  2008-08-08 13:12 ` Keir Fraser
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2008-08-08 12:49 UTC (permalink / raw)
  To: xen-devel

Signed-off-by: Jan Beulich <jbeulich@novell.com>

Index: 2008-08-06/xen/include/asm-x86/spinlock.h
===================================================================
--- 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.000000000 +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"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86: adjust placement of pause insn in _raw_spin_lock()
  2008-08-08 12:49 [PATCH] x86: adjust placement of pause insn in _raw_spin_lock() Jan Beulich
@ 2008-08-08 13:12 ` Keir Fraser
  2008-08-08 14:02   ` Keir Fraser
  2008-08-08 14:12   ` [PATCH] x86: adjust placement of pause insn in_raw_spin_lock() Jan Beulich
  0 siblings, 2 replies; 4+ messages in thread
From: Keir Fraser @ 2008-08-08 13:12 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

Why?

 -- Keir

On 8/8/08 13:49, "Jan Beulich" <jbeulich@novell.com> wrote:

> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> 
> Index: 2008-08-06/xen/include/asm-x86/spinlock.h
> ===================================================================
> --- 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.000000000
> +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"
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86: adjust placement of pause insn in _raw_spin_lock()
  2008-08-08 13:12 ` Keir Fraser
@ 2008-08-08 14:02   ` Keir Fraser
  2008-08-08 14:12   ` [PATCH] x86: adjust placement of pause insn in_raw_spin_lock() Jan Beulich
  1 sibling, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2008-08-08 14:02 UTC (permalink / raw)
  To: Jan Beulich, xen-devel

Ah, I suppose it reduce lock acquisition latency slightly. I'll apply it.

 -- Keir

On 8/8/08 14:12, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote:

> Why?
> 
>  -- Keir
> 
> On 8/8/08 13:49, "Jan Beulich" <jbeulich@novell.com> wrote:
> 
>> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>> 
>> Index: 2008-08-06/xen/include/asm-x86/spinlock.h
>> ===================================================================
>> --- 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.000000000
>> +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"
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] x86: adjust placement of pause insn in_raw_spin_lock()
  2008-08-08 13:12 ` Keir Fraser
  2008-08-08 14:02   ` Keir Fraser
@ 2008-08-08 14:12   ` Jan Beulich
  1 sibling, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2008-08-08 14:12 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

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 <keir.fraser@eu.citrix.com> 08.08.08 15:12 >>>
Why?

 -- Keir

On 8/8/08 13:49, "Jan Beulich" <jbeulich@novell.com> wrote:

> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> 
> Index: 2008-08-06/xen/include/asm-x86/spinlock.h
> ===================================================================
> --- 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.000000000
> +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"
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com 
> http://lists.xensource.com/xen-devel 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-08 14:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-08 12:49 [PATCH] x86: adjust placement of pause insn in _raw_spin_lock() Jan Beulich
2008-08-08 13:12 ` Keir Fraser
2008-08-08 14:02   ` Keir Fraser
2008-08-08 14:12   ` [PATCH] x86: adjust placement of pause insn in_raw_spin_lock() Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.