From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v4] KVM: Introduce direct MSI message injection for in-kernel irqchips Date: Wed, 04 Apr 2012 11:44:23 +0300 Message-ID: <4F7C09E7.3020005@redhat.com> References: <4F734EB3.20500@siemens.com> <4F748AAD.2040103@siemens.com> <4F74B484.30607@siemens.com> <4F7B24EA.2070300@redhat.com> <4F7B29B5.6060703@siemens.com> <20120404083821.GB3003@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Jan Kiszka , Marcelo Tosatti , kvm , Eric Northup To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47218 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753760Ab2DDIoa (ORCPT ); Wed, 4 Apr 2012 04:44:30 -0400 In-Reply-To: <20120404083821.GB3003@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. > 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. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.