aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKeir Fraser <keirf@google.com>2025-09-09 10:00:07 +0000
committerMarc Zyngier <maz@kernel.org>2025-09-15 10:55:23 +0100
commit7d9a0273c45962e9a6bc06f3b87eef7c431c1853 (patch)
tree163b60288a036257cfa8921cbd06537f4c084559 /include
parentKVM: Implement barriers before accessing kvm->buses[] on SRCU read paths (diff)
downloadlinux-7d9a0273c45962e9a6bc06f3b87eef7c431c1853.tar.gz
linux-7d9a0273c45962e9a6bc06f3b87eef7c431c1853.zip
KVM: Avoid synchronize_srcu() in kvm_io_bus_register_dev()
Device MMIO registration may happen quite frequently during VM boot, and the SRCU synchronization each time has a measurable effect on VM startup time. In our experiments it can account for around 25% of a VM's startup time. Replace the synchronization with a deferred free of the old kvm_io_bus structure. Tested-by: Li RongQing <lirongqing@baidu.com> Signed-off-by: Keir Fraser <keirf@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kvm_host.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index e7d6111cf254..103be35caf0d 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -206,6 +206,7 @@ struct kvm_io_range {
struct kvm_io_bus {
int dev_count;
int ioeventfd_count;
+ struct rcu_head rcu;
struct kvm_io_range range[];
};