Re: [PATCH 4/5] kvm: Replace vcpu->swait with rcuwait

2020-04-23 Thread Paolo Bonzini
On 23/04/20 11:19, Peter Zijlstra wrote: >> >> 1) Davidlohr, please post only patches 1-3 to "equalize" the swait and >> rcuwait APIs. >> >> 2) Peter, please prepare a topic branch for those, or provide Acked-by > I don't think I have anything that conflicts with this, so sure, take > the whole

Re: [PATCH 4/5] kvm: Replace vcpu->swait with rcuwait

2020-04-23 Thread Peter Zijlstra
On Thu, Apr 23, 2020 at 10:57:57AM +0200, Paolo Bonzini wrote: > On 23/04/20 10:41, Marc Zyngier wrote: > >> > >> - if (swait_active(kvm_arch_vcpu_wq(vcpu))) > >> + if (rcu_dereference(kvm_arch_vpu_get_wait(vcpu)) != NULL) > > This doesn't compile (wrong function name, and rcu_dereference

Re: [PATCH 4/5] kvm: Replace vcpu->swait with rcuwait

2020-04-23 Thread Paolo Bonzini
On 23/04/20 10:41, Marc Zyngier wrote: >> >> -if (swait_active(kvm_arch_vcpu_wq(vcpu))) >> +if (rcu_dereference(kvm_arch_vpu_get_wait(vcpu)) != NULL) > This doesn't compile (wrong function name, and rcu_dereference takes a > variable). But whatever it would do if we fixed it looks dodgy.

Re: [PATCH 4/5] kvm: Replace vcpu->swait with rcuwait

2020-04-23 Thread Marc Zyngier
On Tue, 21 Apr 2020 21:07:38 -0700 Davidlohr Bueso wrote: > 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

Re: [PATCH 4/5] kvm: Replace vcpu->swait with rcuwait

2020-04-22 Thread Marc Zyngier
On 2020-04-22 05:07, Davidlohr Bueso wrote: 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

[PATCH 4/5] kvm: Replace vcpu->swait with rcuwait

2020-04-22 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

Re: [PATCH 4/5] kvm: Replace vcpu->swait with rcuwait

2020-04-22 Thread Paolo Bonzini
On 22/04/20 06:07, Davidlohr Bueso wrote: > 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 >