From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 8/8 v2] Change irq_lock from mutex to spinlock.
Date: Wed, 12 Aug 2009 12:22:34 +0300 [thread overview]
Message-ID: <4A8289DA.8000806@redhat.com> (raw)
In-Reply-To: <20090812091108.GA4764@redhat.com>
On 08/12/2009 12:11 PM, Gleb Natapov wrote:
> 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.
>
Before the recent change, a mutex was more expensive if there was
contention (waiter would schedule out). Recently the mutex code was
changed to spin while the holder was running.
>> 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.
>
>
Then it can be definitely left as mutex.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2009-08-12 9:22 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-11 12:31 [PATCH 0/8 v2] make interrupt injection lockless (almost) Gleb Natapov
2009-08-11 12:31 ` [PATCH 1/8 v2] Change irq routing table to use gsi indexed array Gleb Natapov
2009-08-12 8:05 ` Avi Kivity
2009-08-12 8:41 ` Gleb Natapov
2009-08-12 9:06 ` Avi Kivity
2009-08-11 12:31 ` [PATCH 2/8 v2] Maintain back mapping from irqchip/pin to gsi Gleb Natapov
2009-08-12 8:09 ` Avi Kivity
2009-08-12 8:42 ` Gleb Natapov
2009-08-12 9:06 ` Avi Kivity
2009-08-12 10:17 ` Gleb Natapov
2009-08-12 10:19 ` Avi Kivity
2009-08-11 12:31 ` [PATCH 3/8 v2] Move irq routing data structure to rcu locking Gleb Natapov
2009-08-11 12:31 ` [PATCH 4/8 v2] Move irq ack notifier list to arch independent code Gleb Natapov
2009-08-11 12:31 ` [PATCH 5/8 v2] Convert irq notifiers lists to RCU locking Gleb Natapov
2009-08-11 12:31 ` [PATCH 6/8 v2] Move IO APIC to its own lock Gleb Natapov
2009-08-12 8:27 ` Avi Kivity
2009-08-12 9:04 ` Gleb Natapov
2009-08-12 9:18 ` Avi Kivity
2009-08-12 9:47 ` Gleb Natapov
2009-08-12 9:57 ` Avi Kivity
2009-08-12 10:05 ` Gleb Natapov
2009-08-12 10:07 ` Avi Kivity
2009-08-11 12:31 ` [PATCH 7/8 v2] Drop kvm->irq_lock lock from irq injection path Gleb Natapov
2009-08-11 12:31 ` [PATCH 8/8 v2] Change irq_lock from mutex to spinlock Gleb Natapov
2009-08-12 8:29 ` Avi Kivity
2009-08-12 9:11 ` Gleb Natapov
2009-08-12 9:22 ` Avi Kivity [this message]
2009-08-12 9:47 ` Gleb Natapov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A8289DA.8000806@redhat.com \
--to=avi@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.