mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] mutex: Better control mutex adaptive spinning config
@ 2009-12-02 19:49 Frederic Weisbecker
  2009-12-02 19:49 ` [PATCH 2/2] mutex: Fix missing conditions to build mutex_spin_on_owner() Frederic Weisbecker
  2009-12-03 13:23 ` [tip:core/locking] mutex: Better control mutex adaptive spinning config tip-bot for Frederic Weisbecker
  0 siblings, 2 replies; 4+ messages in thread
From: Frederic Weisbecker @ 2009-12-02 19:49 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML, Frederic Weisbecker, Peter Zijlstra

Introduce CONFIG_MUTEX_SPIN_ON_OWNER so that we can centralize in a
single place the conditions that determine its definition and use.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
---
 kernel/Kconfig.locks |    3 +++
 kernel/mutex.c       |    4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/Kconfig.locks b/kernel/Kconfig.locks
index d1f86db..88c92fb 100644
--- a/kernel/Kconfig.locks
+++ b/kernel/Kconfig.locks
@@ -197,3 +197,6 @@ config INLINE_WRITE_UNLOCK_IRQ
 
 config INLINE_WRITE_UNLOCK_IRQRESTORE
 	def_bool !DEBUG_SPINLOCK && ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE
+
+config MUTEX_SPIN_ON_OWNER
+	def_bool SMP && !DEBUG_MUTEXES && !HAVE_DEFAULT_NO_SPIN_MUTEXES
diff --git a/kernel/mutex.c b/kernel/mutex.c
index 947b3ad..632f04c 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
@@ -148,8 +148,8 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
 
 	preempt_disable();
 	mutex_acquire(&lock->dep_map, subclass, 0, ip);
-#if defined(CONFIG_SMP) && !defined(CONFIG_DEBUG_MUTEXES) && \
-    !defined(CONFIG_HAVE_DEFAULT_NO_SPIN_MUTEXES)
+
+#ifdef CONFIG_MUTEX_SPIN_ON_OWNER
 	/*
 	 * Optimistic spinning.
 	 *
-- 
1.6.2.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-12-03 13:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-02 19:49 [PATCH 1/2] mutex: Better control mutex adaptive spinning config Frederic Weisbecker
2009-12-02 19:49 ` [PATCH 2/2] mutex: Fix missing conditions to build mutex_spin_on_owner() Frederic Weisbecker
2009-12-03 13:23   ` [tip:core/locking] " tip-bot for Frederic Weisbecker
2009-12-03 13:23 ` [tip:core/locking] mutex: Better control mutex adaptive spinning config tip-bot for Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome