diff options
author | Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> | 2012-03-22 05:55:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-03-23 08:18:57 -0400 |
commit | e335e3eb82dada2765297f6ba501afc7555aba10 (patch) | |
tree | bf805c292a9b30103c4ebe6cb373831ec43c2836 | |
parent | 280fb016bfb098f33df96016cfaa840db77ba2d0 (diff) |
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>
-rw-r--r-- | arch/mips/configs/db1300_defconfig | 2 | ||||
-rw-r--r-- | arch/xtensa/configs/iss_defconfig | 2 | ||||
-rw-r--r-- | include/linux/spinlock_api_smp.h | 2 | ||||
-rw-r--r-- | kernel/Kconfig.locks | 4 | ||||
-rw-r--r-- | kernel/Kconfig.preempt | 1 | ||||
-rw-r--r-- | kernel/spinlock.c | 2 | ||||
-rw-r--r-- | lib/Kconfig.debug | 1 |
7 files changed, 8 insertions, 6 deletions
diff --git a/arch/mips/configs/db1300_defconfig b/arch/mips/configs/db1300_defconfig index c38b190151c4..3590ab5d9791 100644 --- a/arch/mips/configs/db1300_defconfig +++ b/arch/mips/configs/db1300_defconfig | |||
@@ -133,7 +133,7 @@ CONFIG_BLK_DEV_BSG=y | |||
133 | CONFIG_IOSCHED_NOOP=y | 133 | CONFIG_IOSCHED_NOOP=y |
134 | CONFIG_DEFAULT_NOOP=y | 134 | CONFIG_DEFAULT_NOOP=y |
135 | CONFIG_DEFAULT_IOSCHED="noop" | 135 | CONFIG_DEFAULT_IOSCHED="noop" |
136 | CONFIG_INLINE_SPIN_UNLOCK=y | 136 | # CONFIG_UNINLINE_SPIN_UNLOCK is not set |
137 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y | 137 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y |
138 | CONFIG_INLINE_READ_UNLOCK=y | 138 | CONFIG_INLINE_READ_UNLOCK=y |
139 | CONFIG_INLINE_READ_UNLOCK_IRQ=y | 139 | CONFIG_INLINE_READ_UNLOCK_IRQ=y |
diff --git a/arch/xtensa/configs/iss_defconfig b/arch/xtensa/configs/iss_defconfig index f932b30b47fb..ddab37b24741 100644 --- a/arch/xtensa/configs/iss_defconfig +++ b/arch/xtensa/configs/iss_defconfig | |||
@@ -113,7 +113,7 @@ CONFIG_DEFAULT_IOSCHED="noop" | |||
113 | # CONFIG_INLINE_SPIN_LOCK_BH is not set | 113 | # CONFIG_INLINE_SPIN_LOCK_BH is not set |
114 | # CONFIG_INLINE_SPIN_LOCK_IRQ is not set | 114 | # CONFIG_INLINE_SPIN_LOCK_IRQ is not set |
115 | # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set | 115 | # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set |
116 | CONFIG_INLINE_SPIN_UNLOCK=y | 116 | # CONFIG_UNINLINE_SPIN_UNLOCK is not set |
117 | # CONFIG_INLINE_SPIN_UNLOCK_BH is not set | 117 | # CONFIG_INLINE_SPIN_UNLOCK_BH is not set |
118 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y | 118 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y |
119 | # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set | 119 | # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index e253ccd7a604..51df117abe46 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
@@ -67,7 +67,7 @@ _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags) | |||
67 | #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock) | 67 | #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock) |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | #ifdef CONFIG_INLINE_SPIN_UNLOCK | 70 | #ifndef CONFIG_UNINLINE_SPIN_UNLOCK |
71 | #define _raw_spin_unlock(lock) __raw_spin_unlock(lock) | 71 | #define _raw_spin_unlock(lock) __raw_spin_unlock(lock) |
72 | #endif | 72 | #endif |
73 | 73 | ||
diff --git a/kernel/Kconfig.locks b/kernel/Kconfig.locks index 5068e2a4e75f..2251882daf53 100644 --- a/kernel/Kconfig.locks +++ b/kernel/Kconfig.locks | |||
@@ -124,8 +124,8 @@ config INLINE_SPIN_LOCK_IRQSAVE | |||
124 | def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \ | 124 | def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \ |
125 | ARCH_INLINE_SPIN_LOCK_IRQSAVE | 125 | ARCH_INLINE_SPIN_LOCK_IRQSAVE |
126 | 126 | ||
127 | config INLINE_SPIN_UNLOCK | 127 | config UNINLINE_SPIN_UNLOCK |
128 | def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_SPIN_UNLOCK) | 128 | bool |
129 | 129 | ||
130 | config INLINE_SPIN_UNLOCK_BH | 130 | config INLINE_SPIN_UNLOCK_BH |
131 | def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_BH | 131 | def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_BH |
diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt index 24e7cb0ba26a..3f9c97419f02 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt | |||
@@ -36,6 +36,7 @@ config PREEMPT_VOLUNTARY | |||
36 | config PREEMPT | 36 | config PREEMPT |
37 | bool "Preemptible Kernel (Low-Latency Desktop)" | 37 | bool "Preemptible Kernel (Low-Latency Desktop)" |
38 | select PREEMPT_COUNT | 38 | select PREEMPT_COUNT |
39 | select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK | ||
39 | help | 40 | help |
40 | This option reduces the latency of the kernel by making | 41 | This option reduces the latency of the kernel by making |
41 | all kernel code (that is not executing in a critical section) | 42 | all kernel code (that is not executing in a critical section) |
diff --git a/kernel/spinlock.c b/kernel/spinlock.c index 84c7d96918bf..5cdd8065a3ce 100644 --- a/kernel/spinlock.c +++ b/kernel/spinlock.c | |||
@@ -163,7 +163,7 @@ void __lockfunc _raw_spin_lock_bh(raw_spinlock_t *lock) | |||
163 | EXPORT_SYMBOL(_raw_spin_lock_bh); | 163 | EXPORT_SYMBOL(_raw_spin_lock_bh); |
164 | #endif | 164 | #endif |
165 | 165 | ||
166 | #ifndef CONFIG_INLINE_SPIN_UNLOCK | 166 | #ifdef CONFIG_UNINLINE_SPIN_UNLOCK |
167 | void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock) | 167 | void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock) |
168 | { | 168 | { |
169 | __raw_spin_unlock(lock); | 169 | __raw_spin_unlock(lock); |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 05037dc9bde7..f32a41f2a82a 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -499,6 +499,7 @@ config RT_MUTEX_TESTER | |||
499 | config DEBUG_SPINLOCK | 499 | config DEBUG_SPINLOCK |
500 | bool "Spinlock and rw-lock debugging: basic checks" | 500 | bool "Spinlock and rw-lock debugging: basic checks" |
501 | depends on DEBUG_KERNEL | 501 | depends on DEBUG_KERNEL |
502 | select UNINLINE_SPIN_UNLOCK | ||
502 | help | 503 | help |
503 | Say Y here and build SMP to catch missing spinlock initialization | 504 | Say Y here and build SMP to catch missing spinlock initialization |
504 | and certain other kinds of spinlock errors commonly made. This is | 505 | and certain other kinds of spinlock errors commonly made. This is |