]> git.baikalelectronics.ru Git - kernel.git/commit
futex: revert back to the explicit waiter counting code
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 Mar 2014 05:11:17 +0000 (22:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 Mar 2014 05:11:17 +0000 (22:11 -0700)
commited7bb889172527646782979ba8b98fa0a13cb0ea
tree764239232ca4beac8797f274baf924e497f39151
parent932a7e607943e727a145a7e356b4a4dc0bf61af6
futex: revert back to the explicit waiter counting code

Srikar Dronamraju reports that commit b2aa3cb7e91f ("futexes: Avoid
taking the hb->lock if there's nothing to wake up") causes java threads
getting stuck on futexes when runing specjbb on a power7 numa box.

The cause appears to be that the powerpc spinlocks aren't using the same
ticket lock model that we use on x86 (and other) architectures, which in
turn result in the "spin_is_locked()" test in hb_waiters_pending()
occasionally reporting an unlocked spinlock even when there are pending
waiters.

So this reinstates Davidlohr Bueso's original explicit waiter counting
code, which I had convinced Davidlohr to drop in favor of figuring out
the pending waiters by just using the existing state of the spinlock and
the wait queue.

Reported-and-tested-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Original-code-by: Davidlohr Bueso <davidlohr@hp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/futex.c