Re: [PATCH tip/locking/core v9 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt

2015-11-09 Thread Waiman Long
On 11/09/2015 12:29 PM, Peter Zijlstra wrote: On Fri, Nov 06, 2015 at 12:47:49PM -0500, Waiman Long wrote: On 11/06/2015 09:50 AM, Peter Zijlstra wrote: *urgh*, last time we had: + if (pv_wait_head_or_steal()) + goto stolen; while ((val =

Re: [PATCH tip/locking/core v9 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt

2015-11-09 Thread Peter Zijlstra
On Fri, Nov 06, 2015 at 12:47:49PM -0500, Waiman Long wrote: > On 11/06/2015 09:50 AM, Peter Zijlstra wrote: > >*urgh*, last time we had: > > > >+if (pv_wait_head_or_steal()) > >+goto stolen; > > while ((val = smp_load_acquire(>val.counter))& > > _Q_LOCKED_PENDING_MASK) > >

Re: [PATCH tip/locking/core v9 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt

2015-11-09 Thread Peter Zijlstra
On Fri, Nov 06, 2015 at 12:47:49PM -0500, Waiman Long wrote: > On 11/06/2015 09:50 AM, Peter Zijlstra wrote: > >*urgh*, last time we had: > > > >+if (pv_wait_head_or_steal()) > >+goto stolen; > > while ((val = smp_load_acquire(>val.counter))& > > _Q_LOCKED_PENDING_MASK) > >

Re: [PATCH tip/locking/core v9 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt

2015-11-09 Thread Waiman Long
On 11/09/2015 12:29 PM, Peter Zijlstra wrote: On Fri, Nov 06, 2015 at 12:47:49PM -0500, Waiman Long wrote: On 11/06/2015 09:50 AM, Peter Zijlstra wrote: *urgh*, last time we had: + if (pv_wait_head_or_steal()) + goto stolen; while ((val =

Re: [PATCH tip/locking/core v9 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt

2015-11-06 Thread Waiman Long
On 11/06/2015 09:50 AM, Peter Zijlstra wrote: On Fri, Oct 30, 2015 at 07:26:36PM -0400, Waiman Long wrote: @@ -431,35 +432,44 @@ queue: * sequentiality; this is because the set_locked() function below * does not imply a full barrier. * +* The PV

Re: [PATCH tip/locking/core v9 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt

2015-11-06 Thread Peter Zijlstra
On Fri, Oct 30, 2015 at 07:26:36PM -0400, Waiman Long wrote: > @@ -431,35 +432,44 @@ queue: >* sequentiality; this is because the set_locked() function below >* does not imply a full barrier. >* > + * The PV pv_wait_head_lock function, if active, will acquire the lock

Re: [PATCH tip/locking/core v9 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt

2015-11-06 Thread Peter Zijlstra
On Fri, Oct 30, 2015 at 07:26:36PM -0400, Waiman Long wrote: > @@ -431,35 +432,44 @@ queue: >* sequentiality; this is because the set_locked() function below >* does not imply a full barrier. >* > + * The PV pv_wait_head_lock function, if active, will acquire the lock

Re: [PATCH tip/locking/core v9 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt

2015-11-06 Thread Waiman Long
On 11/06/2015 09:50 AM, Peter Zijlstra wrote: On Fri, Oct 30, 2015 at 07:26:36PM -0400, Waiman Long wrote: @@ -431,35 +432,44 @@ queue: * sequentiality; this is because the set_locked() function below * does not imply a full barrier. * +* The PV

[PATCH tip/locking/core v9 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt

2015-10-30 Thread Waiman Long
This patch allows one attempt for the lock waiter to steal the lock when entering the PV slowpath. To prevent lock starvation, the pending bit will be set by the queue head vCPU when it is in the active lock spinning loop to disable any lock stealing attempt. This helps to reduce the performance

[PATCH tip/locking/core v9 5/6] locking/pvqspinlock: Allow 1 lock stealing attempt

2015-10-30 Thread Waiman Long
This patch allows one attempt for the lock waiter to steal the lock when entering the PV slowpath. To prevent lock starvation, the pending bit will be set by the queue head vCPU when it is in the active lock spinning loop to disable any lock stealing attempt. This helps to reduce the performance