From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH] kvm: device-assignment: Catch GSI overflow Date: Fri, 8 May 2009 17:28:00 +0800 Message-ID: <200905081728.01300.sheng@linux.intel.com> References: <20090507170834.26367.91907.stgit@dl380g6-3.ned.telco.ned.telco> <1241716613.23680.31.camel@bling> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Cc: Alex Williamson To: kvm@vger.kernel.org Return-path: Received: from mga10.intel.com ([192.55.52.92]:28420 "EHLO fmsmga102.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751977AbZEHJ12 (ORCPT ); Fri, 8 May 2009 05:27:28 -0400 In-Reply-To: <1241716613.23680.31.camel@bling> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Friday 08 May 2009 01:16:53 Alex Williamson wrote: > On Thu, 2009-05-07 at 11:09 -0600, Alex Williamson wrote: > > Fix the index at which we return -ENOSPC since the kernel side will > > reject a GSI >= KVM_MAX_IRQ_ROUTES. Also, mask as a signed int before > > testing for error. > > Even with this, there still seems to be a fundamental problem with our > consumption of GSIs in kvm. For example, every time a guest writes to > the MSI capabilities area and enables MSI support, we call > kvm_get_irq_route_gsi() to get a new max_used_gsi + 1 value, then call > kvm_add_routing_entry(), which updates max_used_gsi. It doesn't take > too long before we exhaust the GSI space and the device no longer works. > This seems to happen within a minute or two of booting a guest with an > e1000e device sitting idle on a busy network. Do we need to keep a > bitmap of used GSIs or maybe just attempt to reuse the GSI we've gotten > previously for the device? Thanks, Yes, I think a bitmap is much better here. Thanks. -- regards Yang, Sheng > > Alex > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html