From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v4] kvm: Use a bitmap for tracking used GSIs Date: Wed, 13 May 2009 15:35:52 +0300 Message-ID: <4A0ABEA8.6030103@redhat.com> References: <20090512220142.5663.72948.stgit@dl380g6-3.ned.telco.ned.telco> <20090513043835.6696.27384.stgit@dl380g6-3.ned.telco.ned.telco> <4A0A973A.9020502@redhat.com> <1242217702.4786.59.camel@2710p.home> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, sheng.yang@intel.com, mst@redhat.com To: Alex Williamson Return-path: Received: from mx2.redhat.com ([66.187.237.31]:57347 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753256AbZEMMg0 (ORCPT ); Wed, 13 May 2009 08:36:26 -0400 In-Reply-To: <1242217702.4786.59.camel@2710p.home> Sender: kvm-owner@vger.kernel.org List-ID: Alex Williamson wrote: > On Wed, 2009-05-13 at 12:47 +0300, Avi Kivity wrote: > >> Alex Williamson wrote: >> >>> We're currently using a counter to track the most recent GSI we've >>> handed out. This quickly hits KVM_MAX_IRQ_ROUTES when using device >>> assignment with a driver that regularly toggles the MSI enable bit. >>> This can mean only a few minutes of usable run time. Instead, track >>> used GSIs in a bitmap. >>> >>> Signed-off-by: Alex Williamson >>> --- >>> >>> v2: Added mutex to protect gsi bitmap >>> >>> >> Why is the mutex needed? We already have mutex protection in qemu. >> > > If it's unneeded, I'll happily remove it. I was assuming in a guest > with multiple devices these could come in parallel, but maybe the guest > is already serialized for config space accesses via cfc/cf8. > The guest may or may not be serialized; we can't rely on that. But qemu is, and we can. > >> How often does the driver enable/disable the MSI (and, do you now why)? >> If it's often enough it may justify kernel support. (We'll need this >> patch in any case for kernels without this new support). >> > > Seems like multiple times per second. I don't know why. Now I'm > starting to get curious why nobody else seems to be hitting this. I'm > seeing it on an e1000e NIC and Qlogic fibre channel. Is everyone else > using MSI-X or regular interrupts vs MSI? > When you say "multiple times", it is several, or a lot more? Maybe it is NAPI? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.