Re: [PATCH v2 2/5] mutex: Modify the way optimistic spinners are queued

2014-02-02 Thread Paul E. McKenney
On Tue, Jan 28, 2014 at 02:10:41PM -0800, Jason Low wrote: > On Tue, 2014-01-28 at 12:23 -0800, Paul E. McKenney wrote: > > On Tue, Jan 28, 2014 at 11:13:13AM -0800, Jason Low wrote: > > > /* > > >* The cpu_relax() call is a compiler barrier which forces > > > @@ -514,6 +511,7

Re: [PATCH v2 2/5] mutex: Modify the way optimistic spinners are queued

2014-01-28 Thread Jason Low
On Tue, 2014-01-28 at 12:23 -0800, Paul E. McKenney wrote: > On Tue, Jan 28, 2014 at 11:13:13AM -0800, Jason Low wrote: > > /* > > * The cpu_relax() call is a compiler barrier which forces > > @@ -514,6 +511,7 @@ __mutex_lock_common(struct mutex *lock, long state, > > unsi

Re: [PATCH v2 2/5] mutex: Modify the way optimistic spinners are queued

2014-01-28 Thread Davidlohr Bueso
On Tue, 2014-01-28 at 12:23 -0800, Paul E. McKenney wrote: > On Tue, Jan 28, 2014 at 11:13:13AM -0800, Jason Low wrote: > > ... > > if (!owner && (need_resched() || rt_task(task))) > > - goto slowpath; > > + break; > > > > /* > >

Re: [PATCH v2 2/5] mutex: Modify the way optimistic spinners are queued

2014-01-28 Thread Paul E. McKenney
On Tue, Jan 28, 2014 at 12:23:34PM -0800, Paul E. McKenney wrote: > On Tue, Jan 28, 2014 at 11:13:13AM -0800, Jason Low wrote: > > The mutex->spin_mlock was introduced in order to ensure that only 1 thread > > spins for lock acquisition at a time to reduce cache line contention. When > > lock->owne

Re: [PATCH v2 2/5] mutex: Modify the way optimistic spinners are queued

2014-01-28 Thread Paul E. McKenney
On Tue, Jan 28, 2014 at 11:13:13AM -0800, Jason Low wrote: > The mutex->spin_mlock was introduced in order to ensure that only 1 thread > spins for lock acquisition at a time to reduce cache line contention. When > lock->owner is NULL and the lock->count is still not 1, the spinner(s) will > contin

[PATCH v2 2/5] mutex: Modify the way optimistic spinners are queued

2014-01-28 Thread Jason Low
The mutex->spin_mlock was introduced in order to ensure that only 1 thread spins for lock acquisition at a time to reduce cache line contention. When lock->owner is NULL and the lock->count is still not 1, the spinner(s) will continually release and obtain the lock->spin_mlock. This can generate qu