Re: [PATCH v10 06/19] qspinlock: prolong the stay in the pending bit path

2014-05-10 Thread Peter Zijlstra
On Fri, May 09, 2014 at 08:58:47PM -0400, Waiman Long wrote: > On 05/08/2014 02:58 PM, Peter Zijlstra wrote: > >On Wed, May 07, 2014 at 11:01:34AM -0400, Waiman Long wrote: > >>@@ -221,11 +222,37 @@ static inline int trylock_pending(struct qspinlock > >>*lock, u32 *pval) > >> */ > >>for (;

Re: [PATCH v10 06/19] qspinlock: prolong the stay in the pending bit path

2014-05-09 Thread Waiman Long
On 05/08/2014 02:58 PM, Peter Zijlstra wrote: On Wed, May 07, 2014 at 11:01:34AM -0400, Waiman Long wrote: @@ -221,11 +222,37 @@ static inline int trylock_pending(struct qspinlock *lock, u32 *pval) */ for (;;) { /* -* If we observe any contention

Re: [PATCH v10 06/19] qspinlock: prolong the stay in the pending bit path

2014-05-08 Thread Peter Zijlstra
On Wed, May 07, 2014 at 11:01:34AM -0400, Waiman Long wrote: > @@ -221,11 +222,37 @@ static inline int trylock_pending(struct qspinlock > *lock, u32 *pval) >*/ > for (;;) { > /* > - * If we observe any contention; queue. > + * If we observe tha

[PATCH v10 06/19] qspinlock: prolong the stay in the pending bit path

2014-05-07 Thread Waiman Long
There is a problem in the current trylock_pending() function. When the lock is free, but the pending bit holder hasn't grabbed the lock & cleared the pending bit yet, the trylock_pending() function will fail. As a result, the regular queuing code path will be used most of the time even when there