From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH v3 7/8] Move IO APIC to its own lock. Date: Thu, 13 Aug 2009 12:48:10 +0300 Message-ID: <20090813094810.GB23736@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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: avi@redhat.com, kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:38811 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752397AbZHMJsL (ORCPT ); Thu, 13 Aug 2009 05:48:11 -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 n7D9mCeE012740 for ; Thu, 13 Aug 2009 05:48:12 -0400 Content-Disposition: inline In-Reply-To: <20090813091330.GB17022@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: 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. > If so, you can't sleep, must use a spinlock. Either that or I can collect callbacks in critical section and call them afterwords. -- Gleb.