public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: fix ticket spin lock asm constraints
@ 2008-08-29 11:54 Jan Beulich
  2008-08-30  5:28 ` Nick Piggin
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2008-08-29 11:54 UTC (permalink / raw)
  To: mingo, tglx, hpa; +Cc: Nick Piggin, linux-kernel

In addition to these changes I doubt the 'volatile' on all the ticket
lock asm()-s are really necessary.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Nick Piggin <npiggin@suse.de>

---
 include/asm-x86/spinlock.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.27-rc5/include/asm-x86/spinlock.h	2008-08-21 14:37:34.000000000 +0200
+++ 2.6.27-rc5-x86-spinlock-constraints/include/asm-x86/spinlock.h	2008-08-19 12:43:22.000000000 +0200
@@ -101,7 +101,7 @@ static __always_inline int __ticket_spin
 		     "1:"
 		     "sete %b1\n\t"
 		     "movzbl %b1,%0\n\t"
-		     : "=&a" (tmp), "=Q" (new), "+m" (lock->slock)
+		     : "=&a" (tmp), "=&Q" (new), "+m" (lock->slock)
 		     :
 		     : "memory", "cc");
 
@@ -146,7 +146,7 @@ static __always_inline void __ticket_spi
 		     /* don't need lfence here, because loads are in-order */
 		     "jmp 1b\n"
 		     "2:"
-		     : "+Q" (inc), "+m" (lock->slock), "=r" (tmp)
+		     : "+r" (inc), "+m" (lock->slock), "=&r" (tmp)
 		     :
 		     : "memory", "cc");
 }
@@ -166,7 +166,7 @@ static __always_inline int __ticket_spin
 		     "1:"
 		     "sete %b1\n\t"
 		     "movzbl %b1,%0\n\t"
-		     : "=&a" (tmp), "=r" (new), "+m" (lock->slock)
+		     : "=&a" (tmp), "=&q" (new), "+m" (lock->slock)
 		     :
 		     : "memory", "cc");
 




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

* Re: [PATCH] x86: fix ticket spin lock asm constraints
  2008-08-29 11:54 [PATCH] x86: fix ticket spin lock asm constraints Jan Beulich
@ 2008-08-30  5:28 ` Nick Piggin
  2008-09-06 17:49   ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Piggin @ 2008-08-30  5:28 UTC (permalink / raw)
  To: Jan Beulich; +Cc: mingo, tglx, hpa, linux-kernel

Hi,

All these ticket lock patches look pretty good to me. Thanks for going over
it so thoroughly.

On Fri, Aug 29, 2008 at 12:54:59PM +0100, Jan Beulich wrote:
> In addition to these changes I doubt the 'volatile' on all the ticket
> lock asm()-s are really necessary.
> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> Cc: Nick Piggin <npiggin@suse.de>
> 
> ---
>  include/asm-x86/spinlock.h |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> --- linux-2.6.27-rc5/include/asm-x86/spinlock.h	2008-08-21 14:37:34.000000000 +0200
> +++ 2.6.27-rc5-x86-spinlock-constraints/include/asm-x86/spinlock.h	2008-08-19 12:43:22.000000000 +0200
> @@ -101,7 +101,7 @@ static __always_inline int __ticket_spin
>  		     "1:"
>  		     "sete %b1\n\t"
>  		     "movzbl %b1,%0\n\t"
> -		     : "=&a" (tmp), "=Q" (new), "+m" (lock->slock)
> +		     : "=&a" (tmp), "=&Q" (new), "+m" (lock->slock)
>  		     :
>  		     : "memory", "cc");
>  
> @@ -146,7 +146,7 @@ static __always_inline void __ticket_spi
>  		     /* don't need lfence here, because loads are in-order */
>  		     "jmp 1b\n"
>  		     "2:"
> -		     : "+Q" (inc), "+m" (lock->slock), "=r" (tmp)
> +		     : "+r" (inc), "+m" (lock->slock), "=&r" (tmp)
>  		     :
>  		     : "memory", "cc");
>  }
> @@ -166,7 +166,7 @@ static __always_inline int __ticket_spin
>  		     "1:"
>  		     "sete %b1\n\t"
>  		     "movzbl %b1,%0\n\t"
> -		     : "=&a" (tmp), "=r" (new), "+m" (lock->slock)
> +		     : "=&a" (tmp), "=&q" (new), "+m" (lock->slock)
>  		     :
>  		     : "memory", "cc");
>  
> 
> 

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

* Re: [PATCH] x86: fix ticket spin lock asm constraints
  2008-08-30  5:28 ` Nick Piggin
@ 2008-09-06 17:49   ` Ingo Molnar
  0 siblings, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2008-09-06 17:49 UTC (permalink / raw)
  To: Nick Piggin; +Cc: Jan Beulich, tglx, hpa, linux-kernel


* Nick Piggin <npiggin@suse.de> wrote:

> Hi,
> 
> All these ticket lock patches look pretty good to me. Thanks for going over
> it so thoroughly.

yes - and they are all working fine here as well in testing. They are 
queued up for v2.6.28.

	Ingo

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

end of thread, other threads:[~2008-09-06 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-29 11:54 [PATCH] x86: fix ticket spin lock asm constraints Jan Beulich
2008-08-30  5:28 ` Nick Piggin
2008-09-06 17:49   ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox