From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: pci_enable_msix() fails with ENOMEM/EINVAL Date: Wed, 21 Nov 2012 15:25:23 -0700 Message-ID: <1353536723.1809.4.camel@bling.home> References: <190FFE9600054603A543CCDA4408AC89@alyakaslap> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Alex Lyakas Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35593 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756449Ab2KVTRj (ORCPT ); Thu, 22 Nov 2012 14:17:39 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 2012-11-21 at 16:19 +0200, Alex Lyakas wrote: > Hi, > I was advised to turn off irqbalance and reproduced this issue, but > the failure is in a different place now. Now request_threaded_irq() > fails with EBUSY. > According to the code, this can only happen on the path: > request_threaded_irq() -> __setup_irq() > Now in setup irq, the only place where EBUSY can show up for us is here: > ... > raw_spin_lock_irqsave(&desc->lock, flags); > old_ptr = &desc->action; > old = *old_ptr; > if (old) { > /* > * Can't share interrupts unless both agree to and are > * the same type (level, edge, polarity). So both flag > * fields must have IRQF_SHARED set and the bits which > * set the trigger type must match. Also all must > * agree on ONESHOT. > */ > if (!((old->flags & new->flags) & IRQF_SHARED) || > ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK) || > ((old->flags ^ new->flags) & IRQF_ONESHOT)) { > old_name = old->name; > goto mismatch; > } > > /* All handlers must agree on per-cpuness */ > if ((old->flags & IRQF_PERCPU) != > (new->flags & IRQF_PERCPU)) > goto mismatch; > > KVM calls request_threaded_irq() with flags==0, so can it be that > different KVM processes request the same IRQ? Shouldn't be possible, irqs are allocated from a bitmap protected by a mutex, see __irq_alloc_descs > How different KVM > processes spawned simultaneously agree between them on IRQ numbers? They don't, MSI/X vectors are not currently share-able. Can you show that you're actually getting duplicate irq vectors? Thanks, Alex