Move irq routing data structure to rcu locking
PATCH 1/1 Move irq routing data structure to rcu locking
Change it from list to array to make RCU handling simpler.
include/linux/kvm_host.h +2 -1
@@ -161,7 +161,8 @@ struct kvm {struct mutex irq_lock;#ifdef CONFIG_HAVE_KVM_IRQCHIP -struct list_head irq_routing;/* of kvm_kernel_irq_routing_entry */ +struct kvm_kernel_irq_routing_entry *irq_routing; +spinlock_t irq_routing_lock;struct hlist_head mask_notifier_list;#endif
virt/kvm/irq_comm.c +26 -32
113 lines not on this page · raw message
virt/kvm/kvm_main.c +1 -1
@@ -945,7 +945,7 @@ static struct kvm *kvm_create_vm(void)if (IS_ERR (kvm)) goto out;#ifdef CONFIG_HAVE_KVM_IRQCHIP -INIT_LIST_HEAD (&kvm->irq_routing); +spin_lock_init (&kvm->irq_routing_lock);INIT_HLIST_HEAD (&kvm->mask_notifier_list);#endif
--
Gleb.
Quoted 8 lines · Gleb Natapov
Change it from list to array to make RCU handling simpler.
Signed-off-by Gleb Natapov<[email protected]>include/linux/kvm_host.h +0
-0
include/linux/kvm_host.h struct kvm { · line 168
Quoted 9 lines
include/linux/kvm_host.h +2
-1@@ -161,7 +161,8 @@ struct kvm {struct mutex irq_lock;#ifdef CONFIG_HAVE_KVM_IRQCHIP -struct list_head irq_routing;/* of kvm_kernel_irq_routing_entry */ +struct kvm_kernel_irq_routing_entry *irq_routing; +spinlock_t irq_routing_lock;struct hlist_head mask_notifier_list;#endif
Why the new lock?
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 10 lines · Avi Kivity
Quoted 9 lines · Gleb Natapov
Change it from list to array to make RCU handling simpler.
Signed-off-by Gleb Natapov<[email protected]>include/linux/kvm_host.h +0
-0@@ -161,7 +161,8 @@ struct kvm {
Quoted 11 lines
include/linux/kvm_host.h struct kvm { · line 168
Quoted 8 lines
include/linux/kvm_host.h +2
-1struct mutex irq_lock;#ifdef CONFIG_HAVE_KVM_IRQCHIP -struct list_head irq_routing;/* of kvm_kernel_irq_routing_entry */ +struct kvm_kernel_irq_routing_entry *irq_routing; +spinlock_t irq_routing_lock;struct hlist_head mask_notifier_list;#endif Why the new lock?
Currently routing table is protected by irq_lock mutex, but irq_lock is overused. It protects too much of unrelated things and it is not clear what its real purpose in life. I want to rid of it completely.
--
Gleb.
Quoted 25 lines · Gleb Natapov
Quoted 11 lines · Avi Kivity
Quoted 9 lines · Gleb Natapov
Change it from list to array to make RCU handling simpler.
Signed-off-by Gleb Natapov<[email protected]>include/linux/kvm_host.h +0
-0@@ -161,7 +161,8 @@ struct kvm {Quoted 12 lines
include/linux/kvm_host.h struct kvm { · line 168
Quoted 9 lines
include/linux/kvm_host.h +2
-1struct mutex irq_lock;#ifdef CONFIG_HAVE_KVM_IRQCHIP -struct list_head irq_routing;/* of kvm_kernel_irq_routing_entry */ +struct kvm_kernel_irq_routing_entry *irq_routing; +spinlock_t irq_routing_lock;struct hlist_head mask_notifier_list;#endif Why the new lock?
Quoted 4 lines
Currently routing table is protected by
irq_lockmutex, butirq_lockis overused. It protects too much of unrelated things and it is not clear what its real purpose in life. I want to rid of it completely.
Separate discussion/patch.
Signature · 1 line
error compiling committee.c: too many arguments to function