]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
locking/mutexes: Refactor optimistic spinning code
authorDavidlohr Bueso <davidlohr@hp.com>
Wed, 30 Jul 2014 20:41:53 +0000 (13:41 -0700)
committerIngo Molnar <mingo@kernel.org>
Wed, 13 Aug 2014 08:32:01 +0000 (10:32 +0200)
commit76916515d9d84e6552ee5e218e0ed566ad75e600
treeca00b7122cfa29a458ec0bc27aae2c67b1b37013
parentaa9fc0c19bee0cbc152e0e06488095fb69229236
locking/mutexes: Refactor optimistic spinning code

When we fail to acquire the mutex in the fastpath, we end up calling
__mutex_lock_common(). A *lot* goes on in this function. Move out the
optimistic spinning code into mutex_optimistic_spin() and simplify
the former a bit. Furthermore, this is similar to what we have in
rwsems. No logical changes.

Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
Acked-by: Jason Low <jason.low2@hp.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: aswin@hp.com
Cc: mingo@kernel.org
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1406752916-3341-4-git-send-email-davidlohr@hp.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/locking/mutex.c