From: Avi Kivity <avi@redhat.com>
To: Gleb Natapov <gleb@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
"Yang, Sheng" <sheng.yang@intel.com>, kvm <kvm@vger.kernel.org>,
"bonenkamp@gmx.de" <bonenkamp@gmx.de>,
Chris Wright <chrisw@redhat.com>
Subject: Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section
Date: Fri, 23 Apr 2010 14:05:49 +0300 [thread overview]
Message-ID: <4BD17F0D.5070201@redhat.com> (raw)
In-Reply-To: <20100422195514.GE2455@redhat.com>
On 04/22/2010 10:55 PM, Gleb Natapov wrote:
>
>
>>> What about converting PIC/IOAPIC mutexes into spinlocks?
>>>
>> Works for me, but on large guests the spinning will be noticeable.
>> I believe.
>>
> For interrupts going through IOPIC, but we know this is not scalable
> anyway.
>
Yes. We also wanted to convert the ioapic/pic to spinlocks so we could
queue the interrupt from the PIT directly instead of using
KVM_REQ_PENDING_TIMER which keeps confusing me. Chris Lalancette posted
a patchset for this a while back but it was never completed.
I'm not really happy with adding lots of spin_lock_irqsave()s though,
especially on the ioapic which may iterate over all vcpus (not worried
about scaling, but about a malicious guest hurting host latency).
An alternative is make kvm_set_irq() irq safe: if msi, do things
immediately, otherwise post a work item. So we can call kvm_set_irq()
directly from the interrupt.
Alternative alternative (perhaps better for short term): switch
assigned_dev_lock to a mutex (we're already in a work handler, no need
for spinlock). The race between the irq and removal of an assigned
device is closed by free_irq():
lock
mark assigned device as going away
unlock
free_irq()
actually kill it
like invalid mmu pages.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
next prev parent reply other threads:[~2010-04-23 11:05 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-20 15:54 [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section Marcelo Tosatti
2010-04-20 21:49 ` Bonenkamp, Ralf
2010-04-21 7:51 ` Yang, Sheng
2010-04-21 7:48 ` Yang, Sheng
2010-04-21 15:58 ` Marcelo Tosatti
2010-04-21 17:12 ` Gleb Natapov
2010-04-21 17:37 ` Marcelo Tosatti
2010-04-21 17:58 ` Gleb Natapov
2010-04-21 18:29 ` Marcelo Tosatti
2010-04-21 18:38 ` Gleb Natapov
2010-04-22 16:40 ` Marcelo Tosatti
2010-04-22 18:11 ` Gleb Natapov
2010-04-22 19:40 ` Marcelo Tosatti
2010-04-22 19:55 ` Gleb Natapov
2010-04-23 11:05 ` Avi Kivity [this message]
2010-04-23 13:02 ` Chris Lalancette
2010-04-23 13:30 ` Avi Kivity
2010-04-23 17:03 ` KVM: convert ioapic lock to spinlock Marcelo Tosatti
2010-04-21 8:32 ` [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section Avi Kivity
2010-04-21 16:03 ` Marcelo Tosatti
2010-04-21 16:28 ` Avi Kivity
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=4BD17F0D.5070201@redhat.com \
--to=avi@redhat.com \
--cc=bonenkamp@gmx.de \
--cc=chrisw@redhat.com \
--cc=gleb@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=sheng.yang@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox