Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-05 Thread Juergen Gross
On 05/09/17 11:03, Peter Zijlstra wrote: > On Tue, Sep 05, 2017 at 10:52:06AM +0200, Juergen Gross wrote: >>> Hmm, that might work. Could we somehow nop that call when >>> !X86_FEATURE_HYPERVISOR?, that saves native from having to do the call >>> and would be a win for everyone. >> >> So in fact

Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-05 Thread Peter Zijlstra
On Tue, Sep 05, 2017 at 10:52:06AM +0200, Juergen Gross wrote: > > Hmm, that might work. Could we somehow nop that call when > > !X86_FEATURE_HYPERVISOR?, that saves native from having to do the call > > and would be a win for everyone. > > So in fact we want a "always false" shortcut for bare

Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-05 Thread Juergen Gross
On 05/09/17 10:28, Peter Zijlstra wrote: > On Tue, Sep 05, 2017 at 10:14:21AM +0200, Juergen Gross wrote: >> On 05/09/17 10:10, Peter Zijlstra wrote: >>> On Tue, Sep 05, 2017 at 09:35:40AM +0200, Juergen Gross wrote: > So the problem with qspinlock is that it will revert to a classic >

Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-05 Thread Peter Zijlstra
On Tue, Sep 05, 2017 at 10:14:21AM +0200, Juergen Gross wrote: > On 05/09/17 10:10, Peter Zijlstra wrote: > > On Tue, Sep 05, 2017 at 09:35:40AM +0200, Juergen Gross wrote: > >>> So the problem with qspinlock is that it will revert to a classic > >>> test-and-set spinlock if you don't do paravirt

Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-05 Thread Juergen Gross
On 05/09/17 10:10, Peter Zijlstra wrote: > On Tue, Sep 05, 2017 at 09:35:40AM +0200, Juergen Gross wrote: >>> So the problem with qspinlock is that it will revert to a classic >>> test-and-set spinlock if you don't do paravirt but are running a HV. >> >> In the Xen case we just use the bare metal

Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-05 Thread Peter Zijlstra
On Tue, Sep 05, 2017 at 09:35:40AM +0200, Juergen Gross wrote: > > So the problem with qspinlock is that it will revert to a classic > > test-and-set spinlock if you don't do paravirt but are running a HV. > > In the Xen case we just use the bare metal settings when xen_nopvspin > has been

Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-05 Thread Peter Zijlstra
On Tue, Sep 05, 2017 at 08:57:16AM +0200, Oscar Salvador wrote: > It may be that the original patch was just to keep consistency between Xen > and KVM, and also only for testing purposes. > But we find a case when a customer of ours is running some workloads with > 1<->1 mapping between physical

Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-05 Thread Peter Zijlstra
On Tue, Sep 05, 2017 at 08:28:10AM +0200, Juergen Gross wrote: > On 05/09/17 00:21, Davidlohr Bueso wrote: > > On Mon, 04 Sep 2017, Peter Zijlstra wrote: > > > >> For testing its trivial to hack your kernel and I don't feel this is > >> something an Admin can make reasonable decisions about. > >>

Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-05 Thread Juergen Gross
On 05/09/17 00:21, Davidlohr Bueso wrote: > On Mon, 04 Sep 2017, Peter Zijlstra wrote: > >> For testing its trivial to hack your kernel and I don't feel this is >> something an Admin can make reasonable decisions about. >> >> So why? In general less knobs is better. > > +1. > > Also, note how

Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-04 Thread Davidlohr Bueso
On Mon, 04 Sep 2017, Peter Zijlstra wrote: For testing its trivial to hack your kernel and I don't feel this is something an Admin can make reasonable decisions about. So why? In general less knobs is better. +1. Also, note how b8fa70b51aa (xen, pvticketlocks: Add xen_nopvspin parameter to

Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-04 Thread Waiman Long
On 09/04/2017 10:40 AM, Peter Zijlstra wrote: > On Mon, Sep 04, 2017 at 04:28:36PM +0200, Oscar Salvador wrote: >> This is just a resend of Waiman Long's patch. >> I could not find why it was not merged to upstream, so I thought >> to give it another chance. >> What follows is what Waiman Long

Re: [PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-04 Thread Peter Zijlstra
On Mon, Sep 04, 2017 at 04:28:36PM +0200, Oscar Salvador wrote: > This is just a resend of Waiman Long's patch. > I could not find why it was not merged to upstream, so I thought > to give it another chance. > What follows is what Waiman Long wrote. > > Xen has an kernel command line argument

[PATCH resend] x86,kvm: Add a kernel parameter to disable PV spinlock

2017-09-04 Thread Oscar Salvador
This is just a resend of Waiman Long's patch. I could not find why it was not merged to upstream, so I thought to give it another chance. What follows is what Waiman Long wrote. Xen has an kernel command line argument "xen_nopvspin" to disable paravirtual spinlocks. This patch adds a similar