locking/kconfig: Simplify INLINE_SPIN_UNLOCK usage
authorRaghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Thu, 22 Mar 2012 09:55:08 +0000 (15:25 +0530)
committerIngo Molnar <mingo@kernel.org>
Fri, 23 Mar 2012 12:18:57 +0000 (13:18 +0100)
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>
arch/mips/configs/db1300_defconfig
arch/xtensa/configs/iss_defconfig
include/linux/spinlock_api_smp.h
kernel/Kconfig.locks
kernel/Kconfig.preempt
kernel/spinlock.c
lib/Kconfig.debug

index c38b190151c466eb605d7e0d8f21ff6490b49ef2..3590ab5d97916b4bf4ed9dc5e8cfd725ef6fa8c2 100644 (file)
@@ -133,7 +133,7 @@ CONFIG_BLK_DEV_BSG=y
 CONFIG_IOSCHED_NOOP=y
 CONFIG_DEFAULT_NOOP=y
 CONFIG_DEFAULT_IOSCHED="noop"
-CONFIG_INLINE_SPIN_UNLOCK=y
+# CONFIG_UNINLINE_SPIN_UNLOCK is not set
 CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
 CONFIG_INLINE_READ_UNLOCK=y
 CONFIG_INLINE_READ_UNLOCK_IRQ=y
index f932b30b47fb3fe3f868c18d80e03db0e4bcc424..ddab37b24741f03e901d2078911d4c576734f06d 100644 (file)
@@ -113,7 +113,7 @@ CONFIG_DEFAULT_IOSCHED="noop"
 # CONFIG_INLINE_SPIN_LOCK_BH is not set
 # CONFIG_INLINE_SPIN_LOCK_IRQ is not set
 # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
-CONFIG_INLINE_SPIN_UNLOCK=y
+# CONFIG_UNINLINE_SPIN_UNLOCK is not set
 # CONFIG_INLINE_SPIN_UNLOCK_BH is not set
 CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
 # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
index e253ccd7a604c83e003a0db3475bd895b752765b..51df117abe46279223ed1f2a7cb911998aca5ecc 100644 (file)
@@ -67,7 +67,7 @@ _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
 #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock)
 #endif
 
-#ifdef CONFIG_INLINE_SPIN_UNLOCK
+#ifndef CONFIG_UNINLINE_SPIN_UNLOCK
 #define _raw_spin_unlock(lock) __raw_spin_unlock(lock)
 #endif
 
index 5068e2a4e75f05f3c1b823b79ae67c94ffc09130..2251882daf53211745a35321589386e265640c07 100644 (file)
@@ -124,8 +124,8 @@ config INLINE_SPIN_LOCK_IRQSAVE
        def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
                 ARCH_INLINE_SPIN_LOCK_IRQSAVE
 
-config INLINE_SPIN_UNLOCK
-       def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_SPIN_UNLOCK)
+config UNINLINE_SPIN_UNLOCK
+       bool
 
 config INLINE_SPIN_UNLOCK_BH
        def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_BH
index 24e7cb0ba26a9b534eab5ef5b0ed39226f4cd802..3f9c97419f02a69dd180f08b963976649ac2de05 100644 (file)
@@ -36,6 +36,7 @@ config PREEMPT_VOLUNTARY
 config PREEMPT
        bool "Preemptible Kernel (Low-Latency Desktop)"
        select PREEMPT_COUNT
+       select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
        help
          This option reduces the latency of the kernel by making
          all kernel code (that is not executing in a critical section)
index 84c7d96918bf44b8b155d4c72afbd35e6a3bd6cd..5cdd8065a3ce32f6cecadd5a99a59a8ebc937613 100644 (file)
@@ -163,7 +163,7 @@ void __lockfunc _raw_spin_lock_bh(raw_spinlock_t *lock)
 EXPORT_SYMBOL(_raw_spin_lock_bh);
 #endif
 
-#ifndef CONFIG_INLINE_SPIN_UNLOCK
+#ifdef CONFIG_UNINLINE_SPIN_UNLOCK
 void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock)
 {
        __raw_spin_unlock(lock);
index 05037dc9bde73b884886b70c3a0251c880395063..f32a41f2a82aa88ccd3a057abbc69ccf6c1cbe1a 100644 (file)
@@ -499,6 +499,7 @@ config RT_MUTEX_TESTER
 config DEBUG_SPINLOCK
        bool "Spinlock and rw-lock debugging: basic checks"
        depends on DEBUG_KERNEL
+       select UNINLINE_SPIN_UNLOCK
        help
          Say Y here and build SMP to catch missing spinlock initialization
          and certain other kinds of spinlock errors commonly made.  This is