From: Jens Axboe <axboe@kernel.dk>
To: linux-block@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>, Keith Busch <keith.busch@intel.com>,
linux-nvme@lists.infradead.org
Subject: [PATCH 01/11] nvme: don't disable local ints for polled queue
Date: Tue, 13 Nov 2018 08:42:23 -0700 [thread overview]
Message-ID: <20181113154233.15256-2-axboe@kernel.dk> (raw)
In-Reply-To: <20181113154233.15256-1-axboe@kernel.dk>
A polled queued doesn't trigger interrupts, so it's always safe
to grab the queue lock without disabling interrupts.
Cc: Keith Busch <keith.busch@intel.com>
Cc: linux-nvme@lists.infradead.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
drivers/nvme/host/pci.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 6aa86dfcb32c..bb22ae567208 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1067,9 +1067,18 @@ static int __nvme_poll(struct nvme_queue *nvmeq, unsigned int tag)
if (!nvme_cqe_pending(nvmeq))
return 0;
- spin_lock_irq(&nvmeq->cq_lock);
+ /*
+ * Polled queue doesn't have an IRQ, no need to disable ints
+ */
+ if (!nvmeq->polled)
+ local_irq_disable();
+
+ spin_lock(&nvmeq->cq_lock);
found = nvme_process_cq(nvmeq, &start, &end, tag);
- spin_unlock_irq(&nvmeq->cq_lock);
+ spin_unlock(&nvmeq->cq_lock);
+
+ if (!nvmeq->polled)
+ local_irq_enable();
nvme_complete_cqes(nvmeq, start, end);
return found;
--
2.17.1
next prev parent reply other threads:[~2018-11-13 15:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-13 15:42 [PATCHSET v2 0/11] Various block optimizations Jens Axboe
2018-11-13 15:42 ` Jens Axboe [this message]
2018-11-13 15:42 ` [PATCH 02/11] block: add queue_is_mq() helper Jens Axboe
2018-11-14 15:23 ` Christoph Hellwig
2018-11-13 15:42 ` [PATCH 03/11] blk-mq: embed blk_mq_ops directly in the request queue Jens Axboe
2018-11-13 15:42 ` [PATCH 04/11] blk-rq-qos: inline check for q->rq_qos functions Jens Axboe
2018-11-13 15:42 ` [PATCH 05/11] block: avoid ordered task state change for polled IO Jens Axboe
2018-11-14 2:29 ` jianchao.wang
2018-11-14 2:35 ` Jens Axboe
2018-11-13 15:42 ` [PATCH 06/11] block: add polled wakeup task helper Jens Axboe
2018-11-13 15:52 ` Keith Busch
2018-11-13 15:58 ` Jens Axboe
2018-11-13 16:59 ` Jens Axboe
2018-11-13 15:42 ` [PATCH 07/11] block: have ->poll_fn() return number of entries polled Jens Axboe
2018-11-13 15:42 ` [PATCH 08/11] blk-mq: when polling for IO, look for any completion Jens Axboe
2018-11-13 15:42 ` [PATCH 09/11] block: make blk_poll() take a parameter on whether to spin or not Jens Axboe
2018-11-13 15:42 ` [PATCH 10/11] block: for async O_DIRECT, mark us as polling if asked to Jens Axboe
2018-11-13 15:42 ` [PATCH 11/11] block: don't plug for aio/O_DIRECT HIPRI IO Jens Axboe
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=20181113154233.15256-2-axboe@kernel.dk \
--to=axboe@kernel.dk \
--cc=keith.busch@intel.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).