Re: [PATCH v2 10/11] KVM: arm64: vgic-v3: Optimize affinity-based SGI injection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023/9/21 2:17, Marc Zyngier wrote:
Our affinity-based SGI injection code is a bit daft. We iterate
over all the CPUs trying to match the set of affinities that the
guest is trying to reach, leading to some very bad behaviours
if the selected targets are at a high vcpu index.

Instead, we can now use the fact that we have an optimised
MPIDR to vcpu mapping, and only look at the relevant values.

This results in a much faster injection for large VMs, and
in a near constant time, irrespective of the position in the
vcpu index space.

As a bonus, this is mostly deleting a lot of hard-to-read
code. Nobody will complain about that.

Suggested-by: Xu Zhao <zhaoxu.35@xxxxxxxxxxxxx>
Tested-by: Joey Gouly <joey.gouly@xxxxxxx>
Tested-by: Shameer Kolothum <shameerali.kolothum.thodi@xxxxxxxxxx>
Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>

Probably update the comment on top of vgic_v3_dispatch_sgi() to reflect
the new approach.

| * If the interrupt routing mode bit is not set, we iterate over all VCPUs to
| * check for matching ones. If this bit is set, we signal all, but not the
| * calling VCPU.

Zenghui



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux