mutex: Better control mutex adaptive spinning config
authorFrederic Weisbecker <fweisbec@gmail.com>
Wed, 2 Dec 2009 19:49:16 +0000 (20:49 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 3 Dec 2009 10:50:11 +0000 (11:50 +0100)
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>
Acked-by: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <1259783357-8542-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
kernel/Kconfig.locks
kernel/mutex.c

index d1f86db7145196b6e9a4c5e0ba73dea88776a483..88c92fb4461897f06042f599bd1017c3e7a1148d 100644 (file)
@@ -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
index 947b3ad551f8a925c39ef6f53f4f37c16f8a3ea3..632f04c57d82b0207608f10a57f95582833489c1 100644 (file)
@@ -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.
         *