Re: [PATCH] KVM: Boost vCPU candidiate in user mode which is delivering interrupt

2021-04-20 Thread Wanpeng Li
On Tue, 20 Apr 2021 at 18:23, Paolo Bonzini wrote: > > On 20/04/21 10:48, Wanpeng Li wrote: > >> I was thinking of something simpler: > >> > >> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > >> index 9b8e30dd5b9b..455c648f9adc 100644 > >> --- a/virt/kvm/kvm_main.c > >> +++

Re: [PATCH] KVM: Boost vCPU candidiate in user mode which is delivering interrupt

2021-04-20 Thread Paolo Bonzini
On 20/04/21 10:48, Wanpeng Li wrote: I was thinking of something simpler: diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 9b8e30dd5b9b..455c648f9adc 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -3198,10 +3198,9 @@ void kvm_vcpu_on_spin(struct kvm_vcpu *me, bool

Re: [PATCH] KVM: Boost vCPU candidiate in user mode which is delivering interrupt

2021-04-20 Thread Wanpeng Li
On Tue, 20 Apr 2021 at 15:23, Paolo Bonzini wrote: > > On 20/04/21 08:08, Wanpeng Li wrote: > > On Tue, 20 Apr 2021 at 14:02, Wanpeng Li wrote: > >> > >> On Tue, 20 Apr 2021 at 00:59, Paolo Bonzini wrote: > >>> > >>> On 19/04/21 18:32, Sean Christopherson wrote: > If false positives are a

Re: [PATCH] KVM: Boost vCPU candidiate in user mode which is delivering interrupt

2021-04-20 Thread Paolo Bonzini
On 20/04/21 08:08, Wanpeng Li wrote: On Tue, 20 Apr 2021 at 14:02, Wanpeng Li wrote: On Tue, 20 Apr 2021 at 00:59, Paolo Bonzini wrote: On 19/04/21 18:32, Sean Christopherson wrote: If false positives are a big concern, what about adding another pass to the loop and only yielding to

Re: [PATCH] KVM: Boost vCPU candidiate in user mode which is delivering interrupt

2021-04-20 Thread Wanpeng Li
On Tue, 20 Apr 2021 at 14:02, Wanpeng Li wrote: > > On Tue, 20 Apr 2021 at 00:59, Paolo Bonzini wrote: > > > > On 19/04/21 18:32, Sean Christopherson wrote: > > > If false positives are a big concern, what about adding another pass to > > > the loop > > > and only yielding to usermode vCPUs

Re: [PATCH] KVM: Boost vCPU candidiate in user mode which is delivering interrupt

2021-04-20 Thread Wanpeng Li
On Tue, 20 Apr 2021 at 00:59, Paolo Bonzini wrote: > > On 19/04/21 18:32, Sean Christopherson wrote: > > If false positives are a big concern, what about adding another pass to the > > loop > > and only yielding to usermode vCPUs with interrupts in the second full pass? > > I.e. give vCPUs that

Re: [PATCH] KVM: Boost vCPU candidiate in user mode which is delivering interrupt

2021-04-19 Thread Paolo Bonzini
On 19/04/21 18:32, Sean Christopherson wrote: If false positives are a big concern, what about adding another pass to the loop and only yielding to usermode vCPUs with interrupts in the second full pass? I.e. give vCPUs that are already in kernel mode priority, and only yield to handle an

Re: [PATCH] KVM: Boost vCPU candidiate in user mode which is delivering interrupt

2021-04-19 Thread Sean Christopherson
On Mon, Apr 19, 2021, Wanpeng Li wrote: > On Sat, 17 Apr 2021 at 21:09, Paolo Bonzini wrote: > > > > On 16/04/21 05:08, Wanpeng Li wrote: > > > From: Wanpeng Li > > > > > > Both lock holder vCPU and IPI receiver that has halted are condidate for > > > boost. However, the PLE handler was

Re: [PATCH] KVM: Boost vCPU candidiate in user mode which is delivering interrupt

2021-04-19 Thread Wanpeng Li
On Sat, 17 Apr 2021 at 21:09, Paolo Bonzini wrote: > > On 16/04/21 05:08, Wanpeng Li wrote: > > From: Wanpeng Li > > > > Both lock holder vCPU and IPI receiver that has halted are condidate for > > boost. However, the PLE handler was originally designed to deal with the > > lock holder

Re: [PATCH] KVM: Boost vCPU candidiate in user mode which is delivering interrupt

2021-04-17 Thread Paolo Bonzini
On 16/04/21 05:08, Wanpeng Li wrote: From: Wanpeng Li Both lock holder vCPU and IPI receiver that has halted are condidate for boost. However, the PLE handler was originally designed to deal with the lock holder preemption problem. The Intel PLE occurs when the spinlock waiter is in kernel