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

locking/kconfig: Simplify INLINE_SPIN_UNLOCK usage

Get rid of INLINE_SPIN_UNLOCK entirely replacing it with
UNINLINE_SPIN_UNLOCK instead of the reverse meaning.

Whoever wants to change the default spinlock inlining
behavior and uninline the spinlocks for some weird reason,
such as spinlock debugging, paravirt etc. can now all just
select UNINLINE_SPIN_UNLOCK

Original discussion at: https://lkml.org/lkml/2012/3/21/357

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: linux-mips@linux-mips.org
Link: http://lkml.kernel.org/r/20120322095502.30866.75756.sendpatchset@codeblue
[ tidied up the changelog a bit ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Raghavendra K T and committed by
Ingo Molnar
e335e3eb 280fb016

+8 -6
+1 -1
arch/mips/configs/db1300_defconfig
··· 133 133 CONFIG_IOSCHED_NOOP=y 134 134 CONFIG_DEFAULT_NOOP=y 135 135 CONFIG_DEFAULT_IOSCHED="noop" 136 - CONFIG_INLINE_SPIN_UNLOCK=y 136 + # CONFIG_UNINLINE_SPIN_UNLOCK is not set 137 137 CONFIG_INLINE_SPIN_UNLOCK_IRQ=y 138 138 CONFIG_INLINE_READ_UNLOCK=y 139 139 CONFIG_INLINE_READ_UNLOCK_IRQ=y
+1 -1
arch/xtensa/configs/iss_defconfig
··· 113 113 # CONFIG_INLINE_SPIN_LOCK_BH is not set 114 114 # CONFIG_INLINE_SPIN_LOCK_IRQ is not set 115 115 # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set 116 - CONFIG_INLINE_SPIN_UNLOCK=y 116 + # CONFIG_UNINLINE_SPIN_UNLOCK is not set 117 117 # CONFIG_INLINE_SPIN_UNLOCK_BH is not set 118 118 CONFIG_INLINE_SPIN_UNLOCK_IRQ=y 119 119 # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+1 -1
include/linux/spinlock_api_smp.h
··· 67 67 #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock) 68 68 #endif 69 69 70 - #ifdef CONFIG_INLINE_SPIN_UNLOCK 70 + #ifndef CONFIG_UNINLINE_SPIN_UNLOCK 71 71 #define _raw_spin_unlock(lock) __raw_spin_unlock(lock) 72 72 #endif 73 73
+2 -2
kernel/Kconfig.locks
··· 124 124 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \ 125 125 ARCH_INLINE_SPIN_LOCK_IRQSAVE 126 126 127 - config INLINE_SPIN_UNLOCK 128 - def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_SPIN_UNLOCK) 127 + config UNINLINE_SPIN_UNLOCK 128 + bool 129 129 130 130 config INLINE_SPIN_UNLOCK_BH 131 131 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_BH
+1
kernel/Kconfig.preempt
··· 36 36 config PREEMPT 37 37 bool "Preemptible Kernel (Low-Latency Desktop)" 38 38 select PREEMPT_COUNT 39 + select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK 39 40 help 40 41 This option reduces the latency of the kernel by making 41 42 all kernel code (that is not executing in a critical section)
+1 -1
kernel/spinlock.c
··· 163 163 EXPORT_SYMBOL(_raw_spin_lock_bh); 164 164 #endif 165 165 166 - #ifndef CONFIG_INLINE_SPIN_UNLOCK 166 + #ifdef CONFIG_UNINLINE_SPIN_UNLOCK 167 167 void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock) 168 168 { 169 169 __raw_spin_unlock(lock);
+1
lib/Kconfig.debug
··· 499 499 config DEBUG_SPINLOCK 500 500 bool "Spinlock and rw-lock debugging: basic checks" 501 501 depends on DEBUG_KERNEL 502 + select UNINLINE_SPIN_UNLOCK 502 503 help 503 504 Say Y here and build SMP to catch missing spinlock initialization 504 505 and certain other kinds of spinlock errors commonly made. This is