Linux-NVME Archive on lore.kernel.org
 help / color / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: linux-nvme@lists.infradead.org
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@fb.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>
Subject: [RFC] nvme-pci does not disable interrupt-source in threaded mode
Date: Tue, 26 Nov 2019 21:28:14 +0100
Message-ID: <20191126202814.vrfezzu6eon7tbf6@linutronix.de> (raw)

From drivers/nvme/host/pci.c:
| static int queue_request_irq(struct nvme_queue *nvmeq)
| {
|         struct pci_dev *pdev = to_pci_dev(nvmeq->dev->dev);
|         int nr = nvmeq->dev->ctrl.instance;
| 
|         if (use_threaded_interrupts) {
|                 return pci_request_irq(pdev, nvmeq->cq_vector, nvme_irq_check,
|                                 nvme_irq, nvmeq, "nvme%dq%d", nr, nvmeq->qid);

nvme_irq_check() checks if an interrupt is pending and does not disable
interrupt source if the interrupt is pending. It simply wakes the thread.
This works because the MSI-IRQ-controller is handled as edge and it does
not re-trigger. Should the IRQ fallback to non-MSI it would become LEVEL
and will keep the IRQ-line asserted so the threaded handler will no be reached.

One of these should be done:
- remove "use_threaded_interrupts" and rely simply on the "threadirqs"
  kernel command line.
- Let nvme_irq_check() disable the IRQ-source and nvme_irq() should
  enable it again once done.
- Pass IRQF_ONESHOT as irqflags.

Side note:
 msix_request_rcd_irq() (drivers/infiniband/hw/hfi1/msix.c) provides also
 both handlers and (according to the comment) receive_context_interrupt()
 disables the source before waking the thread. This one is fine and I
 did not find more users of pci_request_irq() providing both handlers.

Sebastian

_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 20:28 Sebastian Andrzej Siewior [this message]
2019-11-26 22:28 ` Keith Busch

Reply instructions:

You may reply publically 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=20191126202814.vrfezzu6eon7tbf6@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=tglx@linutronix.de \
    /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

Linux-NVME Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvme/0 linux-nvme/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvme linux-nvme/ https://lore.kernel.org/linux-nvme \
		linux-nvme@lists.infradead.org
	public-inbox-index linux-nvme

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-nvme


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git