From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
Eric Northup <digitaleric@google.com>
Subject: Re: [PATCH v4] KVM: Introduce direct MSI message injection for in-kernel irqchips
Date: Wed, 04 Apr 2012 11:22:43 +0200 [thread overview]
Message-ID: <4F7C12E3.3050702@siemens.com> (raw)
In-Reply-To: <20120404085359.GA3404@redhat.com>
On 2012-04-04 10:53, Michael S. Tsirkin wrote:
> On Wed, Apr 04, 2012 at 11:44:23AM +0300, Avi Kivity wrote:
>> On 04/04/2012 11:38 AM, Michael S. Tsirkin wrote:
>>>>
>>>>>
>>>>> A performance note: delivering an interrupt needs to search all vcpus
>>>>> for an APIC ID match. The previous plan was to cache (or pre-calculate)
>>>>> this lookup in the irq routing table. Now it looks like we'll need a
>>>>> separate cache for this.
>>>>
>>>> As this is non-existent until today, we don't regress here. And it can
>>>> still be added on top later on, transparently.
>>>
>>> I always worry about hash collisions and the cost of
>>> calculating good hash functions.
>>>
>>> We could instead return an index in the cache on injection, maintain in
>>> userspace and use it for fast path on the next injection.
>>
>> Ahem, that is almost the existing routing table to a T.
>>
>>> Will make it easy to use an array index instead of a hash here,
>>> and fallback to a slower ID lookup on mismatch.
>>
>> Need a free ioctl so we can reuse IDs.
>
> No, it could be kernel controlled not userspace controlled. We get both
> and address and an index:
>
> if (table[u.i].addr == u.addr && table[u.i].data == u.data) {
> return table[u.i].id;
> }
>
> u.i = find_lru_idx(&table);
> table[u.i].addr = u.addr;
> table[u.i].data = u.data;
> table[u.i].id = find_id(u.addr, u.data);
> return table[u.i].id;
>
>
>>> Until we do have this fast path we can just fill this value with zeros,
>>> so kernel patch (almost) does not need to change for this -
>>> just the header.
>>
>> Partially implemented interfaces invite breakage.
>
> Hmm true. OK scrap this idea then, it's not clear
> whether we are going to optimize this anyway.
>
Also, the problem is that keeping that ID in userspace requires an
infrastructure like the MSIRoutingCache that I proposed originally. Not
much won /wrt invasiveness there. So we should really do the routing
optimization in the kernel - one day.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2012-04-04 9:22 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-28 17:47 [PATCH v2] KVM: Introduce direct MSI message injection for in-kernel irqchips Jan Kiszka
2012-03-28 17:52 ` Jan Kiszka
2012-03-28 19:58 ` Eric Northup
2012-03-28 20:21 ` Jan Kiszka
2012-03-29 15:39 ` Michael S. Tsirkin
2012-03-29 15:43 ` Jan Kiszka
2012-03-29 16:15 ` [PATCH v3] " Jan Kiszka
2012-03-29 16:46 ` Michael S. Tsirkin
2012-03-29 16:50 ` Jan Kiszka
2012-03-29 18:25 ` Jan Kiszka
2012-03-29 19:14 ` [PATCH v4] " Jan Kiszka
2012-03-29 19:41 ` Michael S. Tsirkin
2012-03-30 7:45 ` Jan Kiszka
2012-03-30 12:45 ` Michael S. Tsirkin
2012-04-03 16:27 ` Avi Kivity
2012-04-03 16:47 ` Jan Kiszka
2012-04-03 16:54 ` Avi Kivity
2012-04-03 17:24 ` Jan Kiszka
2012-04-04 8:47 ` Avi Kivity
2012-04-04 8:38 ` Michael S. Tsirkin
2012-04-04 8:44 ` Avi Kivity
2012-04-04 8:53 ` Michael S. Tsirkin
2012-04-04 9:22 ` Jan Kiszka [this message]
2012-04-04 9:36 ` Avi Kivity
2012-04-04 9:38 ` Jan Kiszka
2012-04-04 9:55 ` Avi Kivity
2012-04-04 10:48 ` Jan Kiszka
2012-04-04 11:50 ` Avi Kivity
2012-04-04 12:01 ` Jan Kiszka
2012-04-10 18:30 ` [PATCH] KVM: Introduce generic interrupt " Jan Kiszka
2012-04-23 14:44 ` Jan Kiszka
2012-04-23 15:17 ` Avi Kivity
2012-04-23 15:32 ` Avi Kivity
2012-04-23 15:55 ` Jan Kiszka
2012-04-24 11:54 ` Avi Kivity
2012-04-24 11:57 ` [PATCH v4] KVM: Introduce direct MSI message " Avi Kivity
2012-04-24 12:07 ` Jan Kiszka
2012-04-24 12:59 ` Avi Kivity
2012-04-24 13:24 ` Jan Kiszka
2012-04-11 22:10 ` [PATCH v3] " Marcelo Tosatti
2012-04-12 9:28 ` Jan Kiszka
2012-04-12 22:38 ` Marcelo Tosatti
2012-04-13 13:45 ` Jan Kiszka
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=4F7C12E3.3050702@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=avi@redhat.com \
--cc=digitaleric@google.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.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