Re: [PATCH v15 13/15] pvqspinlock: Only kick CPU at unlock time

2015-04-09 Thread Peter Zijlstra
On Thu, Apr 09, 2015 at 09:57:21PM +0200, Peter Zijlstra wrote: > On Mon, Apr 06, 2015 at 10:55:48PM -0400, Waiman Long wrote: > > > @@ -219,24 +236,30 @@ static void pv_wait_node(struct mcs_spinlock *node) > > } > > > > /* > > + * Called after setting next->locked = 1 & lock acquired. > > +

Re: [PATCH v15 13/15] pvqspinlock: Only kick CPU at unlock time

2015-04-09 Thread Peter Zijlstra
On Mon, Apr 06, 2015 at 10:55:48PM -0400, Waiman Long wrote: > @@ -219,24 +236,30 @@ static void pv_wait_node(struct mcs_spinlock *node) > } > > /* > + * Called after setting next->locked = 1 & lock acquired. > + * Check if the the CPU has been halted. If so, set the _Q_SLOW_VAL flag > + *

Re: [PATCH v15 13/15] pvqspinlock: Only kick CPU at unlock time

2015-04-09 Thread Peter Zijlstra
On Mon, Apr 06, 2015 at 10:55:48PM -0400, Waiman Long wrote: @@ -219,24 +236,30 @@ static void pv_wait_node(struct mcs_spinlock *node) } /* + * Called after setting next-locked = 1 lock acquired. + * Check if the the CPU has been halted. If so, set the _Q_SLOW_VAL flag + * and put an

Re: [PATCH v15 13/15] pvqspinlock: Only kick CPU at unlock time

2015-04-09 Thread Peter Zijlstra
On Thu, Apr 09, 2015 at 09:57:21PM +0200, Peter Zijlstra wrote: On Mon, Apr 06, 2015 at 10:55:48PM -0400, Waiman Long wrote: @@ -219,24 +236,30 @@ static void pv_wait_node(struct mcs_spinlock *node) } /* + * Called after setting next-locked = 1 lock acquired. + * Check if the

[PATCH v15 13/15] pvqspinlock: Only kick CPU at unlock time

2015-04-06 Thread Waiman Long
Before this patch, a CPU may have been kicked twice before getting the lock - one before it becomes queue head and once before it gets the lock. All these CPU kicking and halting (VMEXIT) can be expensive and slow down system performance, especially in an overcommitted guest. This patch add a new

[PATCH v15 13/15] pvqspinlock: Only kick CPU at unlock time

2015-04-06 Thread Waiman Long
Before this patch, a CPU may have been kicked twice before getting the lock - one before it becomes queue head and once before it gets the lock. All these CPU kicking and halting (VMEXIT) can be expensive and slow down system performance, especially in an overcommitted guest. This patch add a new