futex: Lower the lock contention on the HB lock during wake up
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 17 Jun 2015 08:33:50 +0000 (10:33 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 19 Jun 2015 19:26:38 +0000 (21:26 +0200)
commit802ab58da74bb49ab348d2872190ef26ddc1a3e0
treec62e2f4927ba283ddd5a8fd493c57fa7b9b2dbaf
parent45ab4effc3bee6f8a5cb05652b7bb895ec5b6a7a
futex: Lower the lock contention on the HB lock during wake up

wake_futex_pi() wakes the task before releasing the hash bucket lock
(HB). The first thing the woken up task usually does is to acquire the
lock which requires the HB lock. On SMP Systems this leads to blocking
on the HB lock which is released by the owner shortly after.
This patch rearranges the unlock path by first releasing the HB lock and
then waking up the task.

[ tglx: Fixed up the rtmutex unlock path ]

Originally-from: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mike Galbraith <umgwanakikbuti@gmail.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Link: http://lkml.kernel.org/r/20150617083350.GA2433@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/futex.c
kernel/locking/rtmutex.c
kernel/locking/rtmutex_common.h