Re: [PATCH v11 14/16] pvqspinlock: Add qspinlock para-virtualization support

2014-06-17 Thread Konrad Rzeszutek Wilk
On Sun, Jun 15, 2014 at 03:16:54PM +0200, Peter Zijlstra wrote: > On Thu, Jun 12, 2014 at 04:48:41PM -0400, Waiman Long wrote: > > I don't have a good understanding of the kernel alternatives mechanism. > > I didn't either; I do now, cost me a whole day reading up on > alternative/paravirt code

Re: [PATCH v11 14/16] pvqspinlock: Add qspinlock para-virtualization support

2014-06-17 Thread Konrad Rzeszutek Wilk
On Sun, Jun 15, 2014 at 03:16:54PM +0200, Peter Zijlstra wrote: On Thu, Jun 12, 2014 at 04:48:41PM -0400, Waiman Long wrote: I don't have a good understanding of the kernel alternatives mechanism. I didn't either; I do now, cost me a whole day reading up on alternative/paravirt code

Re: [PATCH v11 14/16] pvqspinlock: Add qspinlock para-virtualization support

2014-06-15 Thread Peter Zijlstra
On Thu, Jun 12, 2014 at 04:48:41PM -0400, Waiman Long wrote: > I don't have a good understanding of the kernel alternatives mechanism. I didn't either; I do now, cost me a whole day reading up on alternative/paravirt code patching. See the patches I just send out; I got the 'native' case with

Re: [PATCH v11 14/16] pvqspinlock: Add qspinlock para-virtualization support

2014-06-15 Thread Peter Zijlstra
On Thu, Jun 12, 2014 at 04:48:41PM -0400, Waiman Long wrote: I don't have a good understanding of the kernel alternatives mechanism. I didn't either; I do now, cost me a whole day reading up on alternative/paravirt code patching. See the patches I just send out; I got the 'native' case with

Re: [PATCH v11 14/16] pvqspinlock: Add qspinlock para-virtualization support

2014-06-12 Thread Waiman Long
On 06/12/2014 04:17 AM, Peter Zijlstra wrote: On Fri, May 30, 2014 at 11:44:00AM -0400, Waiman Long wrote: @@ -19,13 +19,46 @@ extern struct static_key virt_unfairlocks_enabled; * that the clearing the lock bit is done ASAP without artificial delay * due to compiler optimization. */

Re: [PATCH v11 14/16] pvqspinlock: Add qspinlock para-virtualization support

2014-06-12 Thread Peter Zijlstra
On Fri, May 30, 2014 at 11:44:00AM -0400, Waiman Long wrote: > @@ -19,13 +19,46 @@ extern struct static_key virt_unfairlocks_enabled; > * that the clearing the lock bit is done ASAP without artificial delay > * due to compiler optimization. > */ > +#ifdef CONFIG_PARAVIRT_SPINLOCKS > +static

Re: [PATCH v11 14/16] pvqspinlock: Add qspinlock para-virtualization support

2014-06-12 Thread Peter Zijlstra
On Fri, May 30, 2014 at 11:44:00AM -0400, Waiman Long wrote: @@ -19,13 +19,46 @@ extern struct static_key virt_unfairlocks_enabled; * that the clearing the lock bit is done ASAP without artificial delay * due to compiler optimization. */ +#ifdef CONFIG_PARAVIRT_SPINLOCKS +static

Re: [PATCH v11 14/16] pvqspinlock: Add qspinlock para-virtualization support

2014-06-12 Thread Waiman Long
On 06/12/2014 04:17 AM, Peter Zijlstra wrote: On Fri, May 30, 2014 at 11:44:00AM -0400, Waiman Long wrote: @@ -19,13 +19,46 @@ extern struct static_key virt_unfairlocks_enabled; * that the clearing the lock bit is done ASAP without artificial delay * due to compiler optimization. */

[PATCH v11 14/16] pvqspinlock: Add qspinlock para-virtualization support

2014-05-30 Thread Waiman Long
This patch adds base para-virtualization support to the queue spinlock in the same way as was done in the PV ticket lock code. In essence, the lock waiters will spin for a specified number of times (QSPIN_THRESHOLD = 2^14) and then halted itself. The queue head waiter, unlike the other waiter,

[PATCH v11 14/16] pvqspinlock: Add qspinlock para-virtualization support

2014-05-30 Thread Waiman Long
This patch adds base para-virtualization support to the queue spinlock in the same way as was done in the PV ticket lock code. In essence, the lock waiters will spin for a specified number of times (QSPIN_THRESHOLD = 2^14) and then halted itself. The queue head waiter, unlike the other waiter,