Re: [PATCH 07/10] Move irq notifiers lists to its own locking.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/09/2009 05:49 PM, Gleb Natapov wrote:
On Sun, Aug 09, 2009 at 05:52:30PM +0300, Avi Kivity wrote:
On 08/09/2009 03:41 PM, Gleb Natapov wrote:
Signed-off-by: Gleb Natapov<gleb@xxxxxxxxxx>
---
   include/linux/kvm_host.h |    1 +
   virt/kvm/irq_comm.c      |   16 ++++++++--------
   virt/kvm/kvm_main.c      |    1 +
   3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index ce28cb7..8791ce8 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -178,6 +178,7 @@ struct kvm {
   	spinlock_t irq_routing_lock;
   	struct hlist_head mask_notifier_list;
   	struct hlist_head irq_ack_notifier_list;
+	spinlock_t irq_notifier_list_lock;

Again, why?

Because later patches remove irq_lock entirely and lock is need for
write even with rcu. So instead of reusing irq_lock to protect those
structures on write I introduce locks with self descriptive names.

I prefer a /* protected by irq_lock */ rather than lock proliferation. Locks should be split only if they are contended, and your rcu work removes any possible contention.

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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux