summaryrefslogtreecommitdiff
path: root/include/linux/kvm_irqfd.h
diff options
context:
space:
mode:
authorDmytro Maluka <dmy@semihalf.com>2023-03-22 21:43:43 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2023-03-27 10:13:28 -0400
commitd583fbd7066a2dea43050521a95d9770f7d7593e (patch)
tree4ced8cc1d8e18a2af60394d1f9bd7274e9d4d2c3 /include/linux/kvm_irqfd.h
parente5c972c1fadacc858b6a564d056f177275238040 (diff)
KVM: irqfd: Make resampler_list an RCU list
It is useful to be able to do read-only traversal of the list of all the registered irqfd resamplers without locking the resampler_lock mutex. In particular, we are going to traverse it to search for a resampler registered for the given irq of an irqchip, and that will be done with an irqchip spinlock (ioapic->lock) held, so it is undesirable to lock a mutex in this context. So turn this list into an RCU list. For protecting the read side, reuse kvm->irq_srcu which is already used for protecting a number of irq related things (kvm->irq_routing, irqfd->resampler->list, kvm->irq_ack_notifier_list, kvm->arch.mask_notifier_list). Signed-off-by: Dmytro Maluka <dmy@semihalf.com> Message-Id: <20230322204344.50138-2-dmy@semihalf.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/linux/kvm_irqfd.h')
-rw-r--r--include/linux/kvm_irqfd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/kvm_irqfd.h b/include/linux/kvm_irqfd.h
index dac047abdba7..8ad43692e3bb 100644
--- a/include/linux/kvm_irqfd.h
+++ b/include/linux/kvm_irqfd.h
@@ -31,7 +31,7 @@ struct kvm_kernel_irqfd_resampler {
/*
* Entry in list of kvm->irqfd.resampler_list. Use for sharing
* resamplers among irqfds on the same gsi.
- * Accessed and modified under kvm->irqfds.resampler_lock
+ * RCU list modified under kvm->irqfds.resampler_lock
*/
struct list_head link;
};