Commit 7608a43d authored by Davidlohr Bueso's avatar Davidlohr Bueso Committed by Ingo Molnar
Browse files

locking/mutexes: Use MUTEX_SPIN_ON_OWNER when appropriate


 ("locking/mutex: Disable optimistic spinning on some
architectures") added a ARCH_SUPPORTS_ATOMIC_RMW flag to
disable the mutex optimistic feature on specific archs.

Because CONFIG_MUTEX_SPIN_ON_OWNER only depended on DEBUG and
SMP, it was ok to have the ->owner field conditional a bit
flexible. However by adding a new variable to the matter,
we can waste space with the unused field, ie: CONFIG_SMP &&
Signed-off-by: default avatarDavidlohr Bueso <>
Acked-by: default avatarJason Low <>
Signed-off-by: default avatarPeter Zijlstra <>
Cc: Davidlohr Bueso <>
Cc: Heiko Carstens <>
Cc: Jason Low <>
Cc: Linus Torvalds <>
Cc: Paul E. McKenney <>
Cc: Tim Chen <>

Signed-off-by: default avatarIngo Molnar <>
parent 76916515
......@@ -52,7 +52,7 @@ struct mutex {
atomic_t count;
spinlock_t wait_lock;
struct list_head wait_list;
#if defined(CONFIG_DEBUG_MUTEXES) || defined(CONFIG_SMP)
struct task_struct *owner;
......@@ -16,7 +16,7 @@
#define mutex_remove_waiter(lock, waiter, ti) \
__list_del((waiter)->list.prev, (waiter)->
static inline void mutex_set_owner(struct mutex *lock)
lock->owner = current;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment