]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: KVM: Yield CPU when vcpu executes a WFE
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 2 Aug 2013 10:41:13 +0000 (11:41 +0100)
committerJiri Slaby <jslaby@suse.cz>
Thu, 30 Apr 2015 09:14:59 +0000 (11:14 +0200)
commit0057950da5b287bbc3885872c98c57ee33bb26c5
treee2d4892731546f49a67544bec77767d7cb198a43
parentd5e7963fdf52ba609f960466fb864ce81966cd17
arm64: KVM: Yield CPU when vcpu executes a WFE

commit d241aac798eb042e605f78c31a4122e583b2cd13 upstream.

On an (even slightly) oversubscribed system, spinlocks are quickly
becoming a bottleneck, as some vcpus are spinning, waiting for a
lock to be released, while the vcpu holding the lock may not be
running at all.

The solution is to trap blocking WFEs and tell KVM that we're
now spinning. This ensures that other vpus will get a scheduling
boost, allowing the lock to be released more quickly. Also, using
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT slightly improves the performance
when the VM is severely overcommited.

Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/arm64/include/asm/kvm_arm.h
arch/arm64/kvm/Kconfig
arch/arm64/kvm/handle_exit.c