On Thu, Aug 13, 2009 at 12:49:45PM +0300, Avi Kivity wrote: > On 08/13/2009 12:48 PM, Gleb Natapov wrote: > >On Thu, Aug 13, 2009 at 06:13:30AM -0300, Marcelo Tosatti wrote: > >>>+++ b/virt/kvm/ioapic.c > >>>@@ -182,6 +182,7 @@ int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level) > >>> union kvm_ioapic_redirect_entry entry; > >>> int ret = 1; > >>> > >>>+ mutex_lock(&ioapic->lock); > >>> if (irq>= 0&& irq< IOAPIC_NUM_PINS) { > >>> entry = ioapic->redirtbl[irq]; > >>> level ^= entry.fields.polarity; > >>But this is an RCU critical section now, right? > >> > >Correct! Forget about that. It was spinlock, but Avi prefers mutexes. > > Well, I prefer correct code to mutexes. > > >>If so, you can't sleep, must use a spinlock. > >Either that or I can collect callbacks in critical section and call them > >afterwords. > > There's also srcu. > What are the disadvantages? There should be some, otherwise why not use it all the time. -- Gleb. -- 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