Skip to content

Commit

Permalink
mutex: Better control mutex adaptive spinning config
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
  • Loading branch information
fweisbec authored and Ingo Molnar committed Dec 3, 2009
1 parent fa1452e commit c022602
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions kernel/Kconfig.locks
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions kernel/mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit c022602

Please sign in to comment.