locking/mutexes: Unlock the mutex without the wait_lock
locking/mutexes: Unlock the mutex without the wait_lock

When running workloads that have high contention in mutexes on an 8 socket
machine, mutex spinners would often spin for a long time with no lock owner.

The main reason why this is occuring is in __mutex_unlock_common_slowpath(),
if __mutex_slowpath_needs_to_unlock(), then the owner needs to acquire the
mutex->wait_lock before releasing the mutex (setting lock->count to 1). When
the wait_lock is contended, this delays the mutex from being released.
We should be able to release the mutex without holding the wait_lock.

Signed-off-by: Jason Low <09ebf12aa4fd61769490ade56a7655bcf429b765@hp.com>
Cc: c44f108d0c0ea96d2d5cd3344b32a14518a74e59@hp.com
Cc: 1e0ce936bb9b355d257bf5790d2513c3f28be22b@linux.vnet.ibm.com
Cc: a123fdd9fb50e93f03393cfddab9c182b4164439@hp.com
Cc: 69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org
Cc: 00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de
Cc: a21938f5d463ddf41aa718934c205ca2cce8ebbc@redhat.com
Cc: 5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org
Cc: 4aa5652442886f3c4e77d3a743dc27e129c1613f@hp.com
Cc: 8a453bad9912ffe59bc0f0b8abe03df9be19379e@zytor.com
Cc: dbd122ef7b6a09ffecf5db9c9296320f3c94e707@firstfloor.org
Cc: bfa14955daca93db2acc6116543d4fa46c7a22b5@hp.com
Cc: 49115ac805b6db5f3b6f48b0e88b39699dd1bea1@hp.com
Signed-off-by: Peter Zijlstra <3fddac958924aef220f202ca567388ddab3f14a8@infradead.org>
Link: http://lkml.kernel.org/r/1390936396-3962-4-git-send-email-09ebf12aa4fd61769490ade56a7655bcf429b765@hp.com
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs