Re: [RFC PATCH 3/3] locking/mutex: Optimize mutex trylock slowpath

2014-06-04 Thread Jason Low
On Wed, 2014-06-04 at 18:10 -0700, Davidlohr Bueso wrote: > On Wed, 2014-06-04 at 14:47 -0700, Jason Low wrote: > > On Wed, 2014-06-04 at 13:28 -0700, Davidlohr Bueso wrote: > > > On Wed, 2014-06-04 at 12:08 -0700, Jason Low wrote: > > > > In __mutex_trylock_slowpath(), we acquire the wait_lock spi

Re: [RFC PATCH 3/3] locking/mutex: Optimize mutex trylock slowpath

2014-06-04 Thread Davidlohr Bueso
On Wed, 2014-06-04 at 14:47 -0700, Jason Low wrote: > On Wed, 2014-06-04 at 13:28 -0700, Davidlohr Bueso wrote: > > On Wed, 2014-06-04 at 12:08 -0700, Jason Low wrote: > > > In __mutex_trylock_slowpath(), we acquire the wait_lock spinlock, > > > xchg() lock->count with -1, then set lock->count back

Re: [RFC PATCH 3/3] locking/mutex: Optimize mutex trylock slowpath

2014-06-04 Thread Jason Low
On Wed, 2014-06-04 at 13:28 -0700, Davidlohr Bueso wrote: > On Wed, 2014-06-04 at 12:08 -0700, Jason Low wrote: > > In __mutex_trylock_slowpath(), we acquire the wait_lock spinlock, > > xchg() lock->count with -1, then set lock->count back to 0 if there > > are no waiters, and return true if the pr

Re: [RFC PATCH 3/3] locking/mutex: Optimize mutex trylock slowpath

2014-06-04 Thread Davidlohr Bueso
On Wed, 2014-06-04 at 12:08 -0700, Jason Low wrote: > In __mutex_trylock_slowpath(), we acquire the wait_lock spinlock, > xchg() lock->count with -1, then set lock->count back to 0 if there > are no waiters, and return true if the prev lock count was 1. > > However, if we the mutex is already lock