From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 07/10] Move irq notifiers lists to its own locking. Date: Sun, 09 Aug 2009 17:57:50 +0300 Message-ID: <4A7EE3EE.5020407@redhat.com> References: <1249821671-32356-1-git-send-email-gleb@redhat.com> <1249821671-32356-8-git-send-email-gleb@redhat.com> <4A7EE2AE.3020300@redhat.com> <20090809144954.GR4764@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx2.redhat.com ([66.187.237.31]:48185 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbZHIOvz (ORCPT ); Sun, 9 Aug 2009 10:51:55 -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 n79EpuZm029533 for ; Sun, 9 Aug 2009 10:51:56 -0400 In-Reply-To: <20090809144954.GR4764@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 >>> --- >>> 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