]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: Allow in-atomic injection of SPIs
authorMarc Zyngier <maz@kernel.org>
Mon, 25 May 2020 08:45:21 +0000 (09:45 +0100)
committerMarc Zyngier <maz@kernel.org>
Sun, 5 Jul 2020 16:26:15 +0000 (17:26 +0100)
commit5a976ac9140dec776a05161f7cee4d2ac2cdd7f1
treed5c0a98c71e7453a859d8d5b9ee20302db5707d5
parent74a27a5f5a99e6b5adfd790053b6cccac3270c76
KVM: arm64: Allow in-atomic injection of SPIs

On a system that uses SPIs to implement MSIs (as it would be
the case on a GICv2 system exposing a GICv2m to its guests),
we deny the possibility of injecting SPIs on the in-atomic
fast-path.

This results in a very large amount of context-switches
(roughly equivalent to twice the interrupt rate) on the host,
and suboptimal performance for the guest (as measured with
a test workload involving a virtio interface backed by vhost-net).
Given that GICv2 systems are usually on the low-end of the spectrum
performance wise, they could do without the aggravation.

We solved this for GICv3+ITS by having a translation cache. But
SPIs do not need any extra infrastructure, and can be immediately
injected in the virtual distributor as the locking is already
heavy enough that we don't need to worry about anything.

This halves the number of context switches for the same workload.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/vgic/vgic-irqfd.c
arch/arm64/kvm/vgic/vgic-its.c