Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-16 Thread Jason Low
On Thu, 2014-01-16 at 13:05 +0100, Peter Zijlstra wrote: > On Wed, Jan 15, 2014 at 10:46:17PM -0800, Jason Low wrote: > > On Thu, 2014-01-16 at 10:14 +0700, Linus Torvalds wrote: > > > On Thu, Jan 16, 2014 at 9:45 AM, Jason Low wrote: > > > > > > > > Any comments on the below change which unlocks

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-16 Thread Peter Zijlstra
On Wed, Jan 15, 2014 at 10:46:17PM -0800, Jason Low wrote: > On Thu, 2014-01-16 at 10:14 +0700, Linus Torvalds wrote: > > On Thu, Jan 16, 2014 at 9:45 AM, Jason Low wrote: > > > > > > Any comments on the below change which unlocks the mutex before taking > > > the lock->wait_lock to wake up a

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-16 Thread Peter Zijlstra
On Wed, Jan 15, 2014 at 10:46:17PM -0800, Jason Low wrote: On Thu, 2014-01-16 at 10:14 +0700, Linus Torvalds wrote: On Thu, Jan 16, 2014 at 9:45 AM, Jason Low jason.l...@hp.com wrote: Any comments on the below change which unlocks the mutex before taking the lock-wait_lock to wake up a

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-16 Thread Jason Low
On Thu, 2014-01-16 at 13:05 +0100, Peter Zijlstra wrote: On Wed, Jan 15, 2014 at 10:46:17PM -0800, Jason Low wrote: On Thu, 2014-01-16 at 10:14 +0700, Linus Torvalds wrote: On Thu, Jan 16, 2014 at 9:45 AM, Jason Low jason.l...@hp.com wrote: Any comments on the below change which

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-15 Thread Jason Low
On Thu, 2014-01-16 at 10:14 +0700, Linus Torvalds wrote: > On Thu, Jan 16, 2014 at 9:45 AM, Jason Low wrote: > > > > Any comments on the below change which unlocks the mutex before taking > > the lock->wait_lock to wake up a waiter? Thanks. > > Hmm. Doesn't that mean that a new lock owner can

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-15 Thread Linus Torvalds
On Thu, Jan 16, 2014 at 9:45 AM, Jason Low wrote: > > Any comments on the below change which unlocks the mutex before taking > the lock->wait_lock to wake up a waiter? Thanks. Hmm. Doesn't that mean that a new lock owner can come in *before* you've called debug_mutex_unlock and the lockdep

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-15 Thread Jason Low
On Tue, 2014-01-14 at 16:33 -0800, Jason Low wrote: > When running workloads that have high contention in mutexes on an 8 socket > machine, spinners would often spin for a long time with no lock owner. > > One of the potential reasons for this is because a thread can be preempted > after clearing

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-15 Thread Waiman Long
On 01/14/2014 07:33 PM, Jason Low wrote: When running workloads that have high contention in mutexes on an 8 socket machine, spinners would often spin for a long time with no lock owner. One of the potential reasons for this is because a thread can be preempted after clearing lock->owner but

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-15 Thread Waiman Long
On 01/14/2014 07:33 PM, Jason Low wrote: When running workloads that have high contention in mutexes on an 8 socket machine, spinners would often spin for a long time with no lock owner. One of the potential reasons for this is because a thread can be preempted after clearing lock-owner but

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-15 Thread Jason Low
On Tue, 2014-01-14 at 16:33 -0800, Jason Low wrote: When running workloads that have high contention in mutexes on an 8 socket machine, spinners would often spin for a long time with no lock owner. One of the potential reasons for this is because a thread can be preempted after clearing

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-15 Thread Linus Torvalds
On Thu, Jan 16, 2014 at 9:45 AM, Jason Low jason.l...@hp.com wrote: Any comments on the below change which unlocks the mutex before taking the lock-wait_lock to wake up a waiter? Thanks. Hmm. Doesn't that mean that a new lock owner can come in *before* you've called debug_mutex_unlock and the

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-15 Thread Jason Low
On Thu, 2014-01-16 at 10:14 +0700, Linus Torvalds wrote: On Thu, Jan 16, 2014 at 9:45 AM, Jason Low jason.l...@hp.com wrote: Any comments on the below change which unlocks the mutex before taking the lock-wait_lock to wake up a waiter? Thanks. Hmm. Doesn't that mean that a new lock owner

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-14 Thread Jason Low
On Tue, 2014-01-14 at 17:06 -0800, Davidlohr Bueso wrote: > On Tue, 2014-01-14 at 16:33 -0800, Jason Low wrote: > > When running workloads that have high contention in mutexes on an 8 socket > > machine, spinners would often spin for a long time with no lock owner. > > > > One of the potential

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-14 Thread Jason Low
On Tue, 2014-01-14 at 17:00 -0800, Andrew Morton wrote: > On Tue, 14 Jan 2014 16:33:10 -0800 Jason Low wrote: > > > When running workloads that have high contention in mutexes on an 8 socket > > machine, spinners would often spin for a long time with no lock owner. > > > > One of the potential

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-14 Thread Davidlohr Bueso
On Tue, 2014-01-14 at 16:33 -0800, Jason Low wrote: > When running workloads that have high contention in mutexes on an 8 socket > machine, spinners would often spin for a long time with no lock owner. > > One of the potential reasons for this is because a thread can be preempted > after clearing

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-14 Thread Andrew Morton
On Tue, 14 Jan 2014 16:33:10 -0800 Jason Low wrote: > When running workloads that have high contention in mutexes on an 8 socket > machine, spinners would often spin for a long time with no lock owner. > > One of the potential reasons for this is because a thread can be preempted > after

[RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-14 Thread Jason Low
When running workloads that have high contention in mutexes on an 8 socket machine, spinners would often spin for a long time with no lock owner. One of the potential reasons for this is because a thread can be preempted after clearing lock->owner but before releasing the lock, or preempted after

[RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-14 Thread Jason Low
When running workloads that have high contention in mutexes on an 8 socket machine, spinners would often spin for a long time with no lock owner. One of the potential reasons for this is because a thread can be preempted after clearing lock-owner but before releasing the lock, or preempted after

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-14 Thread Andrew Morton
On Tue, 14 Jan 2014 16:33:10 -0800 Jason Low jason.l...@hp.com wrote: When running workloads that have high contention in mutexes on an 8 socket machine, spinners would often spin for a long time with no lock owner. One of the potential reasons for this is because a thread can be preempted

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-14 Thread Davidlohr Bueso
On Tue, 2014-01-14 at 16:33 -0800, Jason Low wrote: When running workloads that have high contention in mutexes on an 8 socket machine, spinners would often spin for a long time with no lock owner. One of the potential reasons for this is because a thread can be preempted after clearing

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-14 Thread Jason Low
On Tue, 2014-01-14 at 17:00 -0800, Andrew Morton wrote: On Tue, 14 Jan 2014 16:33:10 -0800 Jason Low jason.l...@hp.com wrote: When running workloads that have high contention in mutexes on an 8 socket machine, spinners would often spin for a long time with no lock owner. One of the

Re: [RFC 3/3] mutex: When there is no owner, stop spinning after too many tries

2014-01-14 Thread Jason Low
On Tue, 2014-01-14 at 17:06 -0800, Davidlohr Bueso wrote: On Tue, 2014-01-14 at 16:33 -0800, Jason Low wrote: When running workloads that have high contention in mutexes on an 8 socket machine, spinners would often spin for a long time with no lock owner. One of the potential reasons for