diff options
author | Peter Zijlstra <peterz@infradead.org> | 2014-01-29 06:51:42 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-03-11 07:14:56 -0400 |
commit | fb0527bd5ea99bfeb2dd91e3c1433ecf745d6b99 (patch) | |
tree | b3ab4c067c035688d4295fdcadf00170465db7df /include/linux/mutex.h | |
parent | 1d8fe7dc8078b23e060ec62ccb4cdc1ac3c41bf8 (diff) |
locking/mutexes: Introduce cancelable MCS lock for adaptive spinning
Since we want a task waiting for a mutex_lock() to go to sleep and
reschedule on need_resched() we must be able to abort the
mcs_spin_lock() around the adaptive spin.
Therefore implement a cancelable mcs lock.
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: chegu_vinod@hp.com
Cc: paulmck@linux.vnet.ibm.com
Cc: Waiman.Long@hp.com
Cc: torvalds@linux-foundation.org
Cc: tglx@linutronix.de
Cc: riel@redhat.com
Cc: akpm@linux-foundation.org
Cc: davidlohr@hp.com
Cc: hpa@zytor.com
Cc: andi@firstfloor.org
Cc: aswin@hp.com
Cc: scott.norton@hp.com
Cc: Jason Low <jason.low2@hp.com>
Link: http://lkml.kernel.org/n/tip-62hcl5wxydmjzd182zhvk89m@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/mutex.h')
-rw-r--r-- | include/linux/mutex.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/mutex.h b/include/linux/mutex.h index c482e1d2cc49..11692dea18aa 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h | |||
@@ -46,7 +46,7 @@ | |||
46 | * - detects multi-task circular deadlocks and prints out all affected | 46 | * - detects multi-task circular deadlocks and prints out all affected |
47 | * locks and tasks (and only those tasks) | 47 | * locks and tasks (and only those tasks) |
48 | */ | 48 | */ |
49 | struct mcs_spinlock; | 49 | struct optimistic_spin_queue; |
50 | struct mutex { | 50 | struct mutex { |
51 | /* 1: unlocked, 0: locked, negative: locked, possible waiters */ | 51 | /* 1: unlocked, 0: locked, negative: locked, possible waiters */ |
52 | atomic_t count; | 52 | atomic_t count; |
@@ -56,7 +56,7 @@ struct mutex { | |||
56 | struct task_struct *owner; | 56 | struct task_struct *owner; |
57 | #endif | 57 | #endif |
58 | #ifdef CONFIG_MUTEX_SPIN_ON_OWNER | 58 | #ifdef CONFIG_MUTEX_SPIN_ON_OWNER |
59 | struct mcs_spinlock *mcs_lock; /* Spinner MCS lock */ | 59 | struct optimistic_spin_queue *osq; /* Spinner MCS lock */ |
60 | #endif | 60 | #endif |
61 | #ifdef CONFIG_DEBUG_MUTEXES | 61 | #ifdef CONFIG_DEBUG_MUTEXES |
62 | const char *name; | 62 | const char *name; |