Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-08 Thread Radim Krčmář
2017-10-31 10:02-0700, Eduardo Valentin: > Hello Radim, > > On Tue, Oct 24, 2017 at 01:18:59PM +0200, Radim Krčmář wrote: > > 2017-10-23 17:44-0700, Eduardo Valentin: > > > Currently, the existing qspinlock implementation will fallback to > > > test-and-set if the hypervisor has not set the

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-11-08 Thread Radim Krčmář
2017-10-31 10:02-0700, Eduardo Valentin: > Hello Radim, > > On Tue, Oct 24, 2017 at 01:18:59PM +0200, Radim Krčmář wrote: > > 2017-10-23 17:44-0700, Eduardo Valentin: > > > Currently, the existing qspinlock implementation will fallback to > > > test-and-set if the hypervisor has not set the

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-31 Thread Eduardo Valentin
Hello Radim, On Tue, Oct 24, 2017 at 01:18:59PM +0200, Radim Krčmář wrote: > 2017-10-23 17:44-0700, Eduardo Valentin: > > Currently, the existing qspinlock implementation will fallback to > > test-and-set if the hypervisor has not set the PV_UNHALT flag. > > Where have you detected the main

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-31 Thread Eduardo Valentin
Hello Radim, On Tue, Oct 24, 2017 at 01:18:59PM +0200, Radim Krčmář wrote: > 2017-10-23 17:44-0700, Eduardo Valentin: > > Currently, the existing qspinlock implementation will fallback to > > test-and-set if the hypervisor has not set the PV_UNHALT flag. > > Where have you detected the main

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Eduardo Valentin
Hey Waiman, On Tue, Oct 24, 2017 at 12:07:04PM -0400, Waiman Long wrote: > On 10/24/2017 11:37 AM, Eduardo Valentin wrote: > > Hello Peter, > > On Tue, Oct 24, 2017 at 10:13:45AM +0200, Peter Zijlstra wrote: > >> On Mon, Oct 23, 2017 at 05:44:27PM -0700, Eduardo Valentin wrote: > >>> @@ -46,6

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Eduardo Valentin
Hey Waiman, On Tue, Oct 24, 2017 at 12:07:04PM -0400, Waiman Long wrote: > On 10/24/2017 11:37 AM, Eduardo Valentin wrote: > > Hello Peter, > > On Tue, Oct 24, 2017 at 10:13:45AM +0200, Peter Zijlstra wrote: > >> On Mon, Oct 23, 2017 at 05:44:27PM -0700, Eduardo Valentin wrote: > >>> @@ -46,6

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Waiman Long
On 10/24/2017 11:37 AM, Eduardo Valentin wrote: > Hello Peter, > On Tue, Oct 24, 2017 at 10:13:45AM +0200, Peter Zijlstra wrote: >> On Mon, Oct 23, 2017 at 05:44:27PM -0700, Eduardo Valentin wrote: >>> @@ -46,6 +48,8 @@ static inline bool virt_spin_lock(struct qspinlock *lock) >>> if

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Waiman Long
On 10/24/2017 11:37 AM, Eduardo Valentin wrote: > Hello Peter, > On Tue, Oct 24, 2017 at 10:13:45AM +0200, Peter Zijlstra wrote: >> On Mon, Oct 23, 2017 at 05:44:27PM -0700, Eduardo Valentin wrote: >>> @@ -46,6 +48,8 @@ static inline bool virt_spin_lock(struct qspinlock *lock) >>> if

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Eduardo Valentin
Hello Peter, On Tue, Oct 24, 2017 at 10:13:45AM +0200, Peter Zijlstra wrote: > On Mon, Oct 23, 2017 at 05:44:27PM -0700, Eduardo Valentin wrote: > > @@ -46,6 +48,8 @@ static inline bool virt_spin_lock(struct qspinlock *lock) > > if (!static_cpu_has(X86_FEATURE_HYPERVISOR)) > >

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Eduardo Valentin
Hello Peter, On Tue, Oct 24, 2017 at 10:13:45AM +0200, Peter Zijlstra wrote: > On Mon, Oct 23, 2017 at 05:44:27PM -0700, Eduardo Valentin wrote: > > @@ -46,6 +48,8 @@ static inline bool virt_spin_lock(struct qspinlock *lock) > > if (!static_cpu_has(X86_FEATURE_HYPERVISOR)) > >

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Radim Krčmář
2017-10-23 17:44-0700, Eduardo Valentin: > Currently, the existing qspinlock implementation will fallback to > test-and-set if the hypervisor has not set the PV_UNHALT flag. Where have you detected the main source of overhead with pinned VCPUs? Makes me wonder if we couldn't improve general

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Radim Krčmář
2017-10-23 17:44-0700, Eduardo Valentin: > Currently, the existing qspinlock implementation will fallback to > test-and-set if the hypervisor has not set the PV_UNHALT flag. Where have you detected the main source of overhead with pinned VCPUs? Makes me wonder if we couldn't improve general

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Peter Zijlstra
On Mon, Oct 23, 2017 at 05:44:27PM -0700, Eduardo Valentin wrote: > @@ -46,6 +48,8 @@ static inline bool virt_spin_lock(struct qspinlock *lock) > if (!static_cpu_has(X86_FEATURE_HYPERVISOR)) > return false; > > + if (kvm_para_has_feature(KVM_FEATURE_PV_DEDICATED)) > +

Re: [PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-24 Thread Peter Zijlstra
On Mon, Oct 23, 2017 at 05:44:27PM -0700, Eduardo Valentin wrote: > @@ -46,6 +48,8 @@ static inline bool virt_spin_lock(struct qspinlock *lock) > if (!static_cpu_has(X86_FEATURE_HYPERVISOR)) > return false; > > + if (kvm_para_has_feature(KVM_FEATURE_PV_DEDICATED)) > +

[PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-23 Thread Eduardo Valentin
Currently, the existing qspinlock implementation will fallback to test-and-set if the hypervisor has not set the PV_UNHALT flag. This patch gives the opportunity to guest kernels to select between test-and-set and the regular queueu fair lock implementation based on the PV_DEDICATED KVM feature

[PATCH 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set

2017-10-23 Thread Eduardo Valentin
Currently, the existing qspinlock implementation will fallback to test-and-set if the hypervisor has not set the PV_UNHALT flag. This patch gives the opportunity to guest kernels to select between test-and-set and the regular queueu fair lock implementation based on the PV_DEDICATED KVM feature