Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: spinlocks: define dummy __raw_spin_is_contended

Architectures other than mips and x86 are not using ticket spinlocks.
Therefore, the contention on the lock is meaningless, since there is
nobody known to be waiting on it (arguably /fairly/ unfair locks).

Dummy it out to return 0 on other architectures.

Signed-off-by: Kyle McMartin <kyle@redhat.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Kyle McMartin and committed by
Linus Torvalds
a5ef7ca0 d5b56233

+8
+1
arch/mips/include/asm/spinlock.h
··· 51 51 52 52 return (((counters >> 14) - counters) & 0x1fff) > 1; 53 53 } 54 + #define __raw_spin_is_contended __raw_spin_is_contended 54 55 55 56 static inline void __raw_spin_lock(raw_spinlock_t *lock) 56 57 {
+1
arch/x86/include/asm/paravirt.h
··· 1402 1402 { 1403 1403 return PVOP_CALL1(int, pv_lock_ops.spin_is_contended, lock); 1404 1404 } 1405 + #define __raw_spin_is_contended __raw_spin_is_contended 1405 1406 1406 1407 static __always_inline void __raw_spin_lock(struct raw_spinlock *lock) 1407 1408 {
+1
arch/x86/include/asm/spinlock.h
··· 245 245 { 246 246 return __ticket_spin_is_contended(lock); 247 247 } 248 + #define __raw_spin_is_contended __raw_spin_is_contended 248 249 249 250 static __always_inline void __raw_spin_lock(raw_spinlock_t *lock) 250 251 {
+5
include/linux/spinlock.h
··· 124 124 #ifdef CONFIG_GENERIC_LOCKBREAK 125 125 #define spin_is_contended(lock) ((lock)->break_lock) 126 126 #else 127 + 128 + #ifdef __raw_spin_is_contended 127 129 #define spin_is_contended(lock) __raw_spin_is_contended(&(lock)->raw_lock) 130 + #else 131 + #define spin_is_contended(lock) (((void)(lock), 0)) 132 + #endif /*__raw_spin_is_contended*/ 128 133 #endif 129 134 130 135 /**