Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-15 Thread Peter Zijlstra
On Thu, Jun 12, 2014 at 05:08:28PM -0400, Waiman Long wrote: > >Native performance is king, try your very utmost bestest to preserve > >that, paravirt is a distant second and nobody sane should care about the > >virt case at all. > > The patch won't affect native performance unless the kernel is

Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-15 Thread Peter Zijlstra
On Thu, Jun 12, 2014 at 05:08:28PM -0400, Waiman Long wrote: Native performance is king, try your very utmost bestest to preserve that, paravirt is a distant second and nobody sane should care about the virt case at all. The patch won't affect native performance unless the kernel is built

Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-12 Thread Waiman Long
On 06/12/2014 01:50 AM, Peter Zijlstra wrote: On Wed, Jun 11, 2014 at 09:37:55PM -0400, Long, Wai Man wrote: On 6/11/2014 6:54 AM, Peter Zijlstra wrote: On Fri, May 30, 2014 at 11:43:55AM -0400, Waiman Long wrote: Enabling this configuration feature causes a slight decrease the performance of

Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-12 Thread Waiman Long
On 06/12/2014 01:50 AM, Peter Zijlstra wrote: On Wed, Jun 11, 2014 at 09:37:55PM -0400, Long, Wai Man wrote: On 6/11/2014 6:54 AM, Peter Zijlstra wrote: On Fri, May 30, 2014 at 11:43:55AM -0400, Waiman Long wrote: Enabling this configuration feature causes a slight decrease the performance of

Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-11 Thread Peter Zijlstra
On Wed, Jun 11, 2014 at 09:37:55PM -0400, Long, Wai Man wrote: > > On 6/11/2014 6:54 AM, Peter Zijlstra wrote: > >On Fri, May 30, 2014 at 11:43:55AM -0400, Waiman Long wrote: > >>Enabling this configuration feature causes a slight decrease the > >>performance of an uncontended lock-unlock

Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-11 Thread Long, Wai Man
On 6/11/2014 6:54 AM, Peter Zijlstra wrote: On Fri, May 30, 2014 at 11:43:55AM -0400, Waiman Long wrote: Enabling this configuration feature causes a slight decrease the performance of an uncontended lock-unlock operation by about 1-2% mainly due to the use of a static key. However,

Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-11 Thread Peter Zijlstra
On Wed, Jun 11, 2014 at 12:54:02PM +0200, Peter Zijlstra wrote: > > @@ -252,6 +260,18 @@ void queue_spin_lock_slowpath(struct qspinlock *lock, > > u32 val) > > > > BUILD_BUG_ON(CONFIG_NR_CPUS >= (1U << _Q_TAIL_CPU_BITS)); > > > > +#ifdef CONFIG_VIRT_UNFAIR_LOCKS > > + /* > > +* A

Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-11 Thread Peter Zijlstra
On Fri, May 30, 2014 at 11:43:55AM -0400, Waiman Long wrote: > Enabling this configuration feature causes a slight decrease the > performance of an uncontended lock-unlock operation by about 1-2% > mainly due to the use of a static key. However, uncontended lock-unlock > operation are really just

Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-11 Thread Peter Zijlstra
On Fri, May 30, 2014 at 11:43:55AM -0400, Waiman Long wrote: Enabling this configuration feature causes a slight decrease the performance of an uncontended lock-unlock operation by about 1-2% mainly due to the use of a static key. However, uncontended lock-unlock operation are really just a

Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-11 Thread Peter Zijlstra
On Wed, Jun 11, 2014 at 12:54:02PM +0200, Peter Zijlstra wrote: @@ -252,6 +260,18 @@ void queue_spin_lock_slowpath(struct qspinlock *lock, u32 val) BUILD_BUG_ON(CONFIG_NR_CPUS = (1U _Q_TAIL_CPU_BITS)); +#ifdef CONFIG_VIRT_UNFAIR_LOCKS + /* +* A simple test and set

Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-11 Thread Long, Wai Man
On 6/11/2014 6:54 AM, Peter Zijlstra wrote: On Fri, May 30, 2014 at 11:43:55AM -0400, Waiman Long wrote: Enabling this configuration feature causes a slight decrease the performance of an uncontended lock-unlock operation by about 1-2% mainly due to the use of a static key. However,

Re: [PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-06-11 Thread Peter Zijlstra
On Wed, Jun 11, 2014 at 09:37:55PM -0400, Long, Wai Man wrote: On 6/11/2014 6:54 AM, Peter Zijlstra wrote: On Fri, May 30, 2014 at 11:43:55AM -0400, Waiman Long wrote: Enabling this configuration feature causes a slight decrease the performance of an uncontended lock-unlock operation by

[PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-05-30 Thread Waiman Long
Locking is always an issue in a virtualized environment because of 2 different types of problems: 1) Lock holder preemption 2) Lock waiter preemption One solution to the lock waiter preemption problem is to allow unfair lock in a virtualized environment. In this case, a new lock acquirer can

[PATCH v11 09/16] qspinlock, x86: Allow unfair spinlock in a virtual guest

2014-05-30 Thread Waiman Long
Locking is always an issue in a virtualized environment because of 2 different types of problems: 1) Lock holder preemption 2) Lock waiter preemption One solution to the lock waiter preemption problem is to allow unfair lock in a virtualized environment. In this case, a new lock acquirer can