Messages in this thread Patch in this message | | | Date | Fri, 22 Jul 2011 19:56:38 GMT | From | "tip-bot for H. Peter Anvin" <> | Subject | [tip:x86/spinlocks] x86, ticketlock: Use asm volatile for __ticket_unlock_release() |
| |
Commit-ID: 26056c822f9428ddc95fd7ac3008bbb0032d1086 Gitweb: http://git.kernel.org/tip/26056c822f9428ddc95fd7ac3008bbb0032d1086 Author: H. Peter Anvin <hpa@linux.intel.com> AuthorDate: Fri, 22 Jul 2011 11:15:20 -0700 Committer: H. Peter Anvin <hpa@linux.intel.com> CommitDate: Fri, 22 Jul 2011 11:15:20 -0700
x86, ticketlock: Use asm volatile for __ticket_unlock_release()
__ticket_uplock_release() really should have barrier semantics, so use "asm volatile" there.
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Link: http://lkml.kernel.org/r/4E050704.3070409@zytor.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> --- arch/x86/include/asm/spinlock.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index 704b0c3..f8d51dc 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h @@ -36,11 +36,11 @@ static __always_inline void __ticket_unlock_release(struct arch_spinlock *lock) { if (sizeof(lock->tickets.head) == sizeof(u8)) - asm (LOCK_PREFIX "incb %0" - : "+m" (lock->tickets.head) : : "memory"); + asm volatile(LOCK_PREFIX "incb %0" + : "+m" (lock->tickets.head) : : "memory"); else - asm (LOCK_PREFIX "incw %0" - : "+m" (lock->tickets.head) : : "memory"); + asm volatile(LOCK_PREFIX "incw %0" + : "+m" (lock->tickets.head) : : "memory"); } #else
| |