Re: [PATCH] x86: fix ticket spin lock asm constraints

Previous thread: [PATCH] x86: adjust vmalloc_sync_all() for Xen (2nd try) by Jan Beulich on Friday, August 29, 2008 - 4:53 am. (2 messages)

Next thread: [PATCH] x86: use LOCK_PREFIX consistently in tick spin lock code by Jan Beulich on Friday, August 29, 2008 - 4:56 am. (1 message)
From: Jan Beulich
Date: Friday, August 29, 2008 - 4:54 am

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");
 



--

From: Nick Piggin
Date: Friday, August 29, 2008 - 10:28 pm

Hi,

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

--

From: Ingo Molnar
Date: Saturday, September 6, 2008 - 10:49 am

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

	Ingo
--

Previous thread: [PATCH] x86: adjust vmalloc_sync_all() for Xen (2nd try) by Jan Beulich on Friday, August 29, 2008 - 4:53 am. (2 messages)

Next thread: [PATCH] x86: use LOCK_PREFIX consistently in tick spin lock code by Jan Beulich on Friday, August 29, 2008 - 4:56 am. (1 message)