Re: [PATCH 18/15] kvm: Replace vcpu->swait with rcuwait

2020-03-22 Thread Peter Zijlstra
On Sun, Mar 22, 2020 at 09:33:17AM -0700, Davidlohr Bueso wrote: > On Fri, 20 Mar 2020, Peter Zijlstra wrote: > > > On Fri, Mar 20, 2020 at 01:55:26AM -0700, Davidlohr Bueso wrote: > > > - swait_event_interruptible_exclusive(*wq, ((!vcpu->arch.power_off) && > > > -

Re: [PATCH 18/15] kvm: Replace vcpu->swait with rcuwait

2020-03-22 Thread Davidlohr Bueso
On Fri, 20 Mar 2020, Peter Zijlstra wrote: On Fri, Mar 20, 2020 at 01:55:26AM -0700, Davidlohr Bueso wrote: - swait_event_interruptible_exclusive(*wq, ((!vcpu->arch.power_off) && - (!vcpu->arch.pause))); + rcuwait_wait_event(*wait, +

Re: [PATCH 18/15] kvm: Replace vcpu->swait with rcuwait

2020-03-20 Thread Peter Zijlstra
On Fri, Mar 20, 2020 at 01:55:26AM -0700, Davidlohr Bueso wrote: > - swait_event_interruptible_exclusive(*wq, ((!vcpu->arch.power_off) && > -(!vcpu->arch.pause))); > + rcuwait_wait_event(*wait, > +(!vcpu->arch.power_off) &&

Re: [PATCH 18/15] kvm: Replace vcpu->swait with rcuwait

2020-03-20 Thread Paolo Bonzini
On 20/03/20 09:55, Davidlohr Bueso wrote: > Only compiled and tested on x86. It shows :) as the __KVM_HAVE_ARCH_WQP case is broken. But no problem, Paul and I can pick this up and fix it. This is missing: diff --git a/arch/powerpc/include/asm/kvm_book3s.h

[PATCH 18/15] kvm: Replace vcpu->swait with rcuwait

2020-03-20 Thread Davidlohr Bueso
The use of any sort of waitqueue (simple or regular) for wait/waking vcpus has always been an overkill and semantically wrong. Because this is per-vcpu (which is blocked) there is only ever a single waiting vcpu, thus no need for any sort of queue. As such, make use of the rcuwait primitive, with