From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v3 7/8] Move IO APIC to its own lock. Date: Thu, 13 Aug 2009 12:49:45 +0300 Message-ID: <4A83E1B9.3040508@redhat.com> References: <1250079442-5163-1-git-send-email-gleb@redhat.com> <1250079442-5163-8-git-send-email-gleb@redhat.com> <20090813091330.GB17022@amt.cnet> <20090813094810.GB23736@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx2.redhat.com ([66.187.237.31]:38828 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753983AbZHMJtr (ORCPT ); Thu, 13 Aug 2009 05:49:47 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7D9nmPR012926 for ; Thu, 13 Aug 2009 05:49:48 -0400 In-Reply-To: <20090813094810.GB23736@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. -- error compiling committee.c: too many arguments to function