public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm: improve comment on rcu use in irqfd_deassign
@ 2011-03-06 11:03 Michael S. Tsirkin
  2011-03-06 12:36 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Michael S. Tsirkin @ 2011-03-06 11:03 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti, kvm, linux-kernel

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 <mst@redhat.com>
---
 virt/kvm/eventfd.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index 2ca4535..3656849 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -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.
 			 */
-- 
1.7.3.2.91.g446ac

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kvm: improve comment on rcu use in irqfd_deassign
  2011-03-06 11:03 [PATCH] kvm: improve comment on rcu use in irqfd_deassign Michael S. Tsirkin
@ 2011-03-06 12:36 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2011-03-06 12:36 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Marcelo Tosatti, kvm, linux-kernel

On 03/06/2011 01:03 PM, Michael S. Tsirkin wrote:
> 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.

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-06 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-06 11:03 [PATCH] kvm: improve comment on rcu use in irqfd_deassign Michael S. Tsirkin
2011-03-06 12:36 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox