Re: [PATCH v3] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-21 Thread Will Deacon
On Mon, Feb 20, 2017 at 12:58:39PM +0800, Boqun Feng wrote: > > So Waiman, the fact is that in this case, we want the following code > > sequence: > > > > CPU 0 CPU 1 > > = > > {pn->state = vcp

Re: [PATCH v3] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-20 Thread Waiman Long
On 02/19/2017 11:53 PM, Boqun Feng wrote: > On Mon, Feb 20, 2017 at 05:20:52AM +0100, Andrea Parri wrote: >> On Fri, Feb 17, 2017 at 03:43:40PM -0500, Waiman Long wrote: >>> All the locking related cmpxchg's in the following functions are >>> replaced with the _acquire variants: >>> - pv_queued_sp

Re: [PATCH v3] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-20 Thread Peter Zijlstra
On Mon, Feb 20, 2017 at 05:20:52AM +0100, Andrea Parri wrote: > On Fri, Feb 17, 2017 at 03:43:40PM -0500, Waiman Long wrote: > > @@ -361,6 +361,9 @@ static void pv_kick_node(struct qspinlock *lock, struct > > mcs_spinlock *node) > > * observe its next->locked value and advance itself. > >

Re: [PATCH v3] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-19 Thread Boqun Feng
(Really add Will this time ...) On Mon, Feb 20, 2017 at 12:53:58PM +0800, Boqun Feng wrote: > On Mon, Feb 20, 2017 at 05:20:52AM +0100, Andrea Parri wrote: > > On Fri, Feb 17, 2017 at 03:43:40PM -0500, Waiman Long wrote: > > > All the locking related cmpxchg's in the following functions are > > >

Re: [PATCH v3] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-19 Thread Boqun Feng
On Mon, Feb 20, 2017 at 05:20:52AM +0100, Andrea Parri wrote: > On Fri, Feb 17, 2017 at 03:43:40PM -0500, Waiman Long wrote: > > All the locking related cmpxchg's in the following functions are > > replaced with the _acquire variants: > > - pv_queued_spin_steal_lock() > > - trylock_clear_pending(

Re: [PATCH v3] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-19 Thread Andrea Parri
On Fri, Feb 17, 2017 at 03:43:40PM -0500, Waiman Long wrote: > All the locking related cmpxchg's in the following functions are > replaced with the _acquire variants: > - pv_queued_spin_steal_lock() > - trylock_clear_pending() > > This change should help performance on architectures that use LL/

[PATCH v3] locking/pvqspinlock: Relax cmpxchg's to improve performance on some archs

2017-02-17 Thread Waiman Long
All the locking related cmpxchg's in the following functions are replaced with the _acquire variants: - pv_queued_spin_steal_lock() - trylock_clear_pending() This change should help performance on architectures that use LL/SC. On a 2-core 16-thread Power8 system with pvqspinlock explicitly enab