Re: [v5 0/3] KVM: irqchip: synchronize srcu only if needed

From: Yi Wang
Date: Wed Jun 12 2024 - 09:16:42 EST


On Wed, Jun 12, 2024 at 9:19 AM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> On Mon, 06 May 2024 18:17:48 +0800, Yi Wang wrote:
> > From: Yi Wang <foxywang@xxxxxxxxxxx>
> >
> > We found that it may cost more than 20 milliseconds very accidentally
> > to enable cap of KVM_CAP_SPLIT_IRQCHIP on a host which has many vms
> > already.
> >
> > The reason is that when vmm(qemu/CloudHypervisor) invokes
> > KVM_CAP_SPLIT_IRQCHIP kvm will call synchronize_srcu_expedited() and
> > might_sleep and kworker of srcu may cost some delay during this period.
> > One way makes sence is setup empty irq routing when creating vm and
> > so that x86/s390 don't need to setup empty/dummy irq routing.
> >
> > [...]
>
> Applied to kvm-x86 generic, with a lot of fixup. A sanity check on the end
> result would be much appreciated. Thanks!

The code LGTM. I did some tests in my Intel machine and found no problems.

Thanks for your work :)

>
> [1/3] KVM: Setup empty IRQ routing when creating a VM
> https://github.com/kvm-x86/linux/commit/fbe4a7e881d4
> [2/3] KVM: x86: Don't re-setup empty IRQ routing when KVM_CAP_SPLIT_IRQCHIP
> https://github.com/kvm-x86/linux/commit/e3c89f5dd11d
> [3/3] KVM: s390: Don't re-setup dummy routing when KVM_CREATE_IRQCHIP
> https://github.com/kvm-x86/linux/commit/c4201bd24f4a
>
> --
> https://github.com/kvm-x86/linux/tree/next




---
Best wishes
Yi Wang