Re: [PATCH 03/11] qspinlock: Add pending bit

2014-06-24 Thread Peter Zijlstra
On Tue, Jun 17, 2014 at 05:07:29PM -0400, Konrad Rzeszutek Wilk wrote: > > We are trying to make the fastpath as simple as possible as it may be > > inlined. The complexity of the queue spinlock is in the slowpath. > > Sure, but then it shouldn't be called slowpath anymore as it is not > slow. It

Re: [PATCH 03/11] qspinlock: Add pending bit

2014-06-24 Thread Peter Zijlstra
On Tue, Jun 17, 2014 at 07:23:44PM -0400, Konrad Rzeszutek Wilk wrote: > > Actually in my v11 patch, I subdivided the slowpath into a slowpath for > > the pending code and slowerpath for actual queuing. Perhaps, we could > > use quickpath and slowpath instead. Anyway, it is a minor detail that we

Re: [PATCH 03/11] qspinlock: Add pending bit

2014-06-23 Thread Peter Zijlstra
On Tue, Jun 17, 2014 at 04:36:15PM -0400, Konrad Rzeszutek Wilk wrote: > On Sun, Jun 15, 2014 at 02:47:00PM +0200, Peter Zijlstra wrote: > > Because the qspinlock needs to touch a second cacheline; add a pending > > bit and allow a single in-word spinner before we punt to the second > > cacheline.

Re: [PATCH 03/11] qspinlock: Add pending bit

2014-06-18 Thread Konrad Rzeszutek Wilk
On Wed, Jun 18, 2014 at 01:29:48PM +0200, Paolo Bonzini wrote: > Il 17/06/2014 22:36, Konrad Rzeszutek Wilk ha scritto: > >+/* One more attempt - but if we fail mark it as pending. */ > >+if (val == _Q_LOCKED_VAL) { > >+new = Q_LOCKED_VAL |_Q_PENDING_VAL; > >+ > >+ol

Re: [PATCH 03/11] qspinlock: Add pending bit

2014-06-18 Thread Paolo Bonzini
Il 17/06/2014 22:36, Konrad Rzeszutek Wilk ha scritto: + /* One more attempt - but if we fail mark it as pending. */ + if (val == _Q_LOCKED_VAL) { + new = Q_LOCKED_VAL |_Q_PENDING_VAL; + + old = atomic_cmpxchg(&lock->val, val, new); + if (old

Re: [PATCH 03/11] qspinlock: Add pending bit

2014-06-17 Thread Konrad Rzeszutek Wilk
On Jun 17, 2014 6:25 PM, Waiman Long wrote: > > On 06/17/2014 05:10 PM, Konrad Rzeszutek Wilk wrote: > > On Tue, Jun 17, 2014 at 05:07:29PM -0400, Konrad Rzeszutek Wilk wrote: > >> On Tue, Jun 17, 2014 at 04:51:57PM -0400, Waiman Long wrote: > >>> On 06/17/2014 04:36 PM, Konrad Rzeszutek Wilk

Re: [PATCH 03/11] qspinlock: Add pending bit

2014-06-17 Thread Waiman Long
On 06/17/2014 05:10 PM, Konrad Rzeszutek Wilk wrote: On Tue, Jun 17, 2014 at 05:07:29PM -0400, Konrad Rzeszutek Wilk wrote: On Tue, Jun 17, 2014 at 04:51:57PM -0400, Waiman Long wrote: On 06/17/2014 04:36 PM, Konrad Rzeszutek Wilk wrote: On Sun, Jun 15, 2014 at 02:47:00PM +0200, Peter Zijlstra

Re: [PATCH 03/11] qspinlock: Add pending bit

2014-06-17 Thread Konrad Rzeszutek Wilk
On Tue, Jun 17, 2014 at 04:51:57PM -0400, Waiman Long wrote: > On 06/17/2014 04:36 PM, Konrad Rzeszutek Wilk wrote: > >On Sun, Jun 15, 2014 at 02:47:00PM +0200, Peter Zijlstra wrote: > >>Because the qspinlock needs to touch a second cacheline; add a pending > >>bit and allow a single in-word spinne

Re: [PATCH 03/11] qspinlock: Add pending bit

2014-06-17 Thread Konrad Rzeszutek Wilk
On Tue, Jun 17, 2014 at 05:07:29PM -0400, Konrad Rzeszutek Wilk wrote: > On Tue, Jun 17, 2014 at 04:51:57PM -0400, Waiman Long wrote: > > On 06/17/2014 04:36 PM, Konrad Rzeszutek Wilk wrote: > > >On Sun, Jun 15, 2014 at 02:47:00PM +0200, Peter Zijlstra wrote: > > >>Because the qspinlock needs to to

Re: [PATCH 03/11] qspinlock: Add pending bit

2014-06-17 Thread Waiman Long
On 06/17/2014 04:36 PM, Konrad Rzeszutek Wilk wrote: On Sun, Jun 15, 2014 at 02:47:00PM +0200, Peter Zijlstra wrote: Because the qspinlock needs to touch a second cacheline; add a pending bit and allow a single in-word spinner before we punt to the second cacheline. Could you add this in the de

Re: [PATCH 03/11] qspinlock: Add pending bit

2014-06-17 Thread Konrad Rzeszutek Wilk
On Sun, Jun 15, 2014 at 02:47:00PM +0200, Peter Zijlstra wrote: > Because the qspinlock needs to touch a second cacheline; add a pending > bit and allow a single in-word spinner before we punt to the second > cacheline. Could you add this in the description please: And by second cacheline we mean

[PATCH 03/11] qspinlock: Add pending bit

2014-06-15 Thread Peter Zijlstra
Because the qspinlock needs to touch a second cacheline; add a pending bit and allow a single in-word spinner before we punt to the second cacheline. Signed-off-by: Peter Zijlstra --- include/asm-generic/qspinlock_types.h | 12 ++- kernel/locking/qspinlock.c| 109 +