locking/mutexes: Introduce cancelable MCS lock for adaptive spinning
authorPeter Zijlstra <peterz@infradead.org>
Wed, 29 Jan 2014 11:51:42 +0000 (12:51 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 11 Mar 2014 11:14:56 +0000 (12:14 +0100)
commitfb0527bd5ea99bfeb2dd91e3c1433ecf745d6b99
treeb3ab4c067c035688d4295fdcadf00170465db7df
parent1d8fe7dc8078b23e060ec62ccb4cdc1ac3c41bf8
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>
include/linux/mutex.h
kernel/locking/Makefile
kernel/locking/mcs_spinlock.c [new file with mode: 0644]
kernel/locking/mcs_spinlock.h
kernel/locking/mutex.c