From: Jan Kiszka <jan.kiszka@web.de>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
linux-kernel@vger.kernel.org, kvm <kvm@vger.kernel.org>,
Tom Lyon <pugs@cisco.com>,
Alex Williamson <alex.williamson@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH 0/5] KVM&genirq: Enable adaptive IRQ sharing for passed-through devices
Date: Sat, 04 Dec 2010 15:54:04 +0100 [thread overview]
Message-ID: <4CFA560C.3050206@web.de> (raw)
In-Reply-To: <alpine.LFD.2.00.1012041526280.2653@localhost6.localdomain6>
[-- Attachment #1: Type: text/plain, Size: 2564 bytes --]
Am 04.12.2010 15:41, Thomas Gleixner wrote:
> Jan,
>
> On Sat, 4 Dec 2010, Jan Kiszka wrote:
>
>> Am 04.12.2010 11:37, Thomas Gleixner wrote:
>>> On Sat, 4 Dec 2010, Jan Kiszka wrote:
>>> If interrupt is shared, then you want to keep the current behaviour:
>>>
>>> disable at line level (IRQF_ONESHOT)
>>> run handler thread (PCI level masking)
>>> reenable at line level in irq_finalize_oneshot()
>>> reenable at PCI level when guest is done
>>
>> If the interrupt is shared, we must mask at PCI level inside the primary
>> handler as we also have to support non-threaded users of the same line.
>> So we always have a transition line-level -> device-level
>> masking in a primary handler.
>
> Sorry that left out the hard irq part. Of course it needs to do the
> PCI level masking in the primary one.
>
>> reduce the latency. So both threaded and non-threaded cases should be
>> addressable by any approach.
>
> The oneshot magic should work on non threaded cases as well. Needs
> some modifications, but nothing complex.
>
>>> If interrupts are in flight accross request/free then this change
>>> takes effect when the next interrupt comes in.
>>
>> For registration, that might be too late. We need to synchronize on
>> in-flight interrupts for that line and then ensure that it gets enabled
>> independently of the registered user. That user may have applied
>> outdated information, thus would block the line for too long if user
>> space decides to do something else.
>
> No, that's really just a corner case when going from one to two
> handlers and I don't think it matters much. If you setup a new driver
> it's not really important whether that first thing comes in a few ms
> later.
The worst case remains infinite (user space never signals end of interrupt).
>
> Also there is a pretty simple solution for this: The core code knows,
> that there is an ONESHOT interrupt in flight, so it simply can call
It doesn't synchronize the tail part against the masking in the
handler(s), that's driver business.
> the primary handler of that device with the appropriate flag set
> (maybe an additional one to indicate the transition) and let that deal
> with it. Needs some thought vs. locking and races, but that shouldn't
> be hard.
Yes, I thought about this kind of transition (re-invoking the existing
handler) already. We do need notification of the switch (at least for
exclusive->shared) as only the driver can migrate the masking for
in-flight interrupts.
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
next prev parent reply other threads:[~2010-12-04 14:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 23:37 [PATCH 0/5] KVM&genirq: Enable adaptive IRQ sharing for passed-through devices Jan Kiszka
2010-12-03 23:37 ` [PATCH 1/5] genirq: Pass descriptor to __free_irq Jan Kiszka
2010-12-03 23:37 ` [PATCH 2/5] genirq: Introduce interrupt sharing notifier Jan Kiszka
2010-12-03 23:37 ` [PATCH 3/5] KVM: Split up MSI-X assigned device IRQ handler Jan Kiszka
2010-12-03 23:37 ` [PATCH 4/5] KVM: Clean up unneeded void pointer casts Jan Kiszka
2010-12-03 23:37 ` [PATCH 5/5] KVM: Allow host IRQ sharing for passed-through PCI 2.3 devices Jan Kiszka
2010-12-06 16:21 ` Avi Kivity
2010-12-06 16:34 ` Jan Kiszka
2010-12-06 16:40 ` Avi Kivity
2010-12-06 16:46 ` Jan Kiszka
2010-12-06 17:01 ` Avi Kivity
2010-12-06 17:11 ` Jan Kiszka
2010-12-04 10:37 ` [PATCH 0/5] KVM&genirq: Enable adaptive IRQ sharing for passed-through devices Thomas Gleixner
2010-12-04 11:34 ` Jan Kiszka
2010-12-04 14:41 ` Thomas Gleixner
2010-12-04 14:54 ` Jan Kiszka [this message]
2010-12-04 16:10 ` Thomas Gleixner
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=4CFA560C.3050206@web.de \
--to=jan.kiszka@web.de \
--cc=alex.williamson@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pugs@cisco.com \
--cc=tglx@linutronix.de \
/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