Re: [PATCH v9 03/19] qspinlock: Add pending bit

2014-04-18 Thread Ingo Molnar
* Waiman Long waiman.l...@hp.com 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. Signed-off-by: Peter Zijlstra pet...@infradead.org Signed-off-by: Waiman Long waiman.l...@hp.com

Re: [PATCH v9 03/19] qspinlock: Add pending bit

2014-04-18 Thread Peter Zijlstra
On Thu, Apr 17, 2014 at 05:20:31PM -0400, Waiman Long wrote: + while ((val = atomic_read(lock-val)) _Q_LOCKED_MASK) + arch_mutex_cpu_relax(); That was a cpu_relax(). Yes, but arch_mutex_cpu_relax() is the same as cpu_relax() for x86. Yeah, so why bother typing more? Let the

Re: [PATCH v9 03/19] qspinlock: Add pending bit

2014-04-18 Thread Waiman Long
On 04/18/2014 03:42 AM, Ingo Molnar wrote: * Waiman Longwaiman.l...@hp.com 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. Signed-off-by: Peter Zijlstrapet...@infradead.org

Re: [PATCH v9 03/19] qspinlock: Add pending bit

2014-04-18 Thread Konrad Rzeszutek Wilk
On Fri, Apr 18, 2014 at 12:23:29PM -0400, Waiman Long wrote: On 04/18/2014 03:42 AM, Ingo Molnar wrote: * Waiman Longwaiman.l...@hp.com 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

Re: [PATCH v9 03/19] qspinlock: Add pending bit

2014-04-18 Thread Waiman Long
On 04/18/2014 04:13 AM, Peter Zijlstra wrote: On Thu, Apr 17, 2014 at 05:20:31PM -0400, Waiman Long wrote: + while ((val = atomic_read(lock-val)) _Q_LOCKED_MASK) + arch_mutex_cpu_relax(); That was a cpu_relax(). Yes, but arch_mutex_cpu_relax() is the same as cpu_relax()

Re: [PATCH v9 03/19] qspinlock: Add pending bit

2014-04-18 Thread Waiman Long
On 04/18/2014 12:35 PM, Konrad Rzeszutek Wilk wrote: On Fri, Apr 18, 2014 at 12:23:29PM -0400, Waiman Long wrote: On 04/18/2014 03:42 AM, Ingo Molnar wrote: * Waiman Longwaiman.l...@hp.com wrote: Because the qspinlock needs to touch a second cacheline; add a pending bit and allow a single

[PATCH v9 03/19] qspinlock: Add pending bit

2014-04-17 Thread Waiman Long
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 pet...@infradead.org Signed-off-by: Waiman Long waiman.l...@hp.com --- include/asm-generic/qspinlock_types.h | 12

Re: [PATCH v9 03/19] qspinlock: Add pending bit

2014-04-17 Thread Peter Zijlstra
On Thu, Apr 17, 2014 at 11:03:55AM -0400, Waiman Long wrote: +/** + * trylock_pending - try to acquire queue spinlock using the pending bit + * @lock : Pointer to queue spinlock structure + * @pval : Pointer to value of the queue spinlock 32-bit word + * Return: 1 if lock acquired, 0

Re: [PATCH v9 03/19] qspinlock: Add pending bit

2014-04-17 Thread Waiman Long
On 04/17/2014 11:42 AM, Peter Zijlstra wrote: On Thu, Apr 17, 2014 at 11:03:55AM -0400, Waiman Long wrote: +/** + * trylock_pending - try to acquire queue spinlock using the pending bit + * @lock : Pointer to queue spinlock structure + * @pval : Pointer to value of the queue spinlock 32-bit