From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 8/8 v2] Change irq_lock from mutex to spinlock. Date: Wed, 12 Aug 2009 12:11:08 +0300 Message-ID: <20090812091108.GA4764@redhat.com> References: <1249993895-11119-1-git-send-email-gleb@redhat.com> <1249993895-11119-9-git-send-email-gleb@redhat.com> <4A827D4C.6070709@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:47121 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932236AbZHLJLJ (ORCPT ); Wed, 12 Aug 2009 05:11:09 -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 n7C9BAs0021414 for ; Wed, 12 Aug 2009 05:11:10 -0400 Content-Disposition: inline In-Reply-To: <4A827D4C.6070709@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Aug 12, 2009 at 11:29:00AM +0300, Avi Kivity wrote: > On 08/11/2009 03:31 PM, Gleb Natapov wrote: >> Change irq_lock from mutex to spinlock. We do not sleep while holding >> it. >> > > But why change? > Isn't it more lightweight? For the remaining use of the lock it doesn't really matters, but if I see mutex used somewhere I assume there are users that sleeps. > The only motivation I can see is to allow injection from irqfd and > interrupt contexts without requiring a tasklet/work. But that needs > spin_lock_irqsave(), not spin_lock(). > After this series the lock is used only to protect modification of irq table, add/delete of ack notifiers and irq source id allocator. None of this affects injection from irqfd. -- Gleb.