Skip to content

Commit

Permalink
KVM: improve comment on rcu use in irqfd_deassign
Browse files Browse the repository at this point in the history
The RCU use in kvm_irqfd_deassign is tricky: we have rcu_assign_pointer
but no synchronize_rcu: synchronize_rcu is done by kvm_irq_routing_update
which we share a spinlock with.

Fix up a comment in an attempt to make this clearer.

Signed-off-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>
  • Loading branch information
mstsirkin authored and matosatti committed Mar 17, 2011
1 parent 676646e commit c8ce057
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions virt/kvm/eventfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,9 @@ kvm_irqfd_deassign(struct kvm *kvm, int fd, int gsi)
if (irqfd->eventfd == eventfd && irqfd->gsi == gsi) {
/*
* This rcu_assign_pointer is needed for when
* another thread calls kvm_irqfd_update before
* we flush workqueue below.
* another thread calls kvm_irq_routing_update before
* we flush workqueue below (we synchronize with
* kvm_irq_routing_update using irqfds.lock).
* It is paired with synchronize_rcu done by caller
* of that function.
*/
Expand Down

0 comments on commit c8ce057

Please sign in to comment.