public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Alex Lyakas <alex@zadarastorage.com>
Cc: kvm@vger.kernel.org
Subject: Re: pci_enable_msix() fails with ENOMEM/EINVAL
Date: Wed, 21 Nov 2012 15:25:23 -0700	[thread overview]
Message-ID: <1353536723.1809.4.camel@bling.home> (raw)
In-Reply-To: <CAOcd+r28ot-060WQhUPkuM1Bt7t-_jOggAZKNSJxurNYVs2b-w@mail.gmail.com>

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


  reply	other threads:[~2012-11-22 19:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19 15:18 pci_enable_msix() fails with ENOMEM/EINVAL Alex Lyakas
2012-11-21 14:19 ` Alex Lyakas
2012-11-21 22:25   ` Alex Williamson [this message]
2012-11-22  8:52     ` Alex Lyakas
2012-11-26 20:04       ` Alex Williamson
2012-11-29  8:42         ` Alex Lyakas
2012-11-29 15:56           ` Alex Williamson
2012-12-08 12:14             ` Alex Lyakas
2012-12-10 20:45               ` Alex Williamson
2012-12-12 13:42                 ` Alex Lyakas
2012-12-12 20:10                   ` Alex Williamson
2012-12-18 14:46                     ` Alex Lyakas
2012-12-19 23:39                       ` Alex Williamson

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=1353536723.1809.4.camel@bling.home \
    --to=alex.williamson@redhat.com \
    --cc=alex@zadarastorage.com \
    --cc=kvm@vger.kernel.org \
    /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