Re: [PATCH 2/2] locking/qspinlock: Limit # of spins in _Q_PENDING_VAL wait loop

2018-04-11 Thread Waiman Long
On 04/11/2018 11:22 AM, Catalin Marinas wrote: > Hi Waiman, > > On Mon, Apr 09, 2018 at 02:08:52PM -0400, Waiman Long wrote: >> @@ -311,13 +320,19 @@ void queued_spin_lock_slowpath(struct qspinlock *lock, >> u32 val) >> return; >> >> /* >> - * wait for in-progress pending->

Re: [PATCH 2/2] locking/qspinlock: Limit # of spins in _Q_PENDING_VAL wait loop

2018-04-11 Thread Catalin Marinas
Hi Waiman, On Mon, Apr 09, 2018 at 02:08:52PM -0400, Waiman Long wrote: > @@ -311,13 +320,19 @@ void queued_spin_lock_slowpath(struct qspinlock *lock, > u32 val) > return; > > /* > - * wait for in-progress pending->locked hand-overs > + * wait for in-progress pendi

Re: [PATCH 2/2] locking/qspinlock: Limit # of spins in _Q_PENDING_VAL wait loop

2018-04-10 Thread Waiman Long
On 04/10/2018 02:26 PM, Will Deacon wrote: > Hi Waiman, > > On Mon, Apr 09, 2018 at 02:08:52PM -0400, Waiman Long wrote: >> A locker in the pending code path is doing an infinite number of spins >> when waiting for the _Q_PENDING_VAL to _Q_LOCK_VAL transition. There >> is a concern that lock starva

Re: [PATCH 2/2] locking/qspinlock: Limit # of spins in _Q_PENDING_VAL wait loop

2018-04-10 Thread Will Deacon
Hi Waiman, On Mon, Apr 09, 2018 at 02:08:52PM -0400, Waiman Long wrote: > A locker in the pending code path is doing an infinite number of spins > when waiting for the _Q_PENDING_VAL to _Q_LOCK_VAL transition. There > is a concern that lock starvation can happen concurrent lockers are > able to ta

[PATCH 2/2] locking/qspinlock: Limit # of spins in _Q_PENDING_VAL wait loop

2018-04-09 Thread Waiman Long
A locker in the pending code path is doing an infinite number of spins when waiting for the _Q_PENDING_VAL to _Q_LOCK_VAL transition. There is a concern that lock starvation can happen concurrent lockers are able to take the lock in the cmpxchg loop without queuing and pass it around amongst themse