From: Keith Busch <kbusch@meta.com>
To: <linux-block@vger.kernel.org>, <axboe@kernel.dk>,
<linux-nvme@lists.infradead.org>, <hch@lst.de>,
<sagi@grimberg.me>
Cc: Keith Busch <kbusch@kernel.org>,
Martin Belanger <Martin.Belanger@dell.com>,
Daniel Wagner <dwagner@suse.de>
Subject: [PATCH 3/3] blk-mq: directly poll requests
Date: Tue, 21 Mar 2023 17:23:50 -0700 [thread overview]
Message-ID: <20230322002350.4038048-4-kbusch@meta.com> (raw)
In-Reply-To: <20230322002350.4038048-1-kbusch@meta.com>
From: Keith Busch <kbusch@kernel.org>
Polling needs a bio with a valid bi_bdev, but neither of those are
guaranteed for polled driver requests. Make request based polling use
directly use blk-mq's polling function.
When executing a request from a polled hctx, we know the request's
cookie, and that it's from a live multi-queue that supports polling, so
we can safely skip everything that bio_poll provides.
Link: http://lists.infradead.org/pipermail/linux-nvme/2023-March/038340.html
Reported-by: Martin Belanger <Martin.Belanger@dell.com>
Reported-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
block/blk-mq.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 4e30459df8151..932d2e95392e6 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1334,8 +1334,6 @@ bool blk_rq_is_poll(struct request *rq)
return false;
if (rq->mq_hctx->type != HCTX_TYPE_POLL)
return false;
- if (WARN_ON_ONCE(!rq->bio))
- return false;
return true;
}
EXPORT_SYMBOL_GPL(blk_rq_is_poll);
@@ -1343,7 +1341,7 @@ EXPORT_SYMBOL_GPL(blk_rq_is_poll);
static void blk_rq_poll_completion(struct request *rq, struct completion *wait)
{
do {
- bio_poll(rq->bio, NULL, 0);
+ blk_mq_poll(rq->q, blk_rq_to_qc(rq), NULL, 0);
cond_resched();
} while (!completion_done(wait));
}
--
2.34.1
next prev parent reply other threads:[~2023-03-22 0:24 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 0:23 [PATCH 0/3] nvme fabrics polling fixes Keith Busch
2023-03-22 0:23 ` [PATCH 1/3] nvme-fabrics: add queue setup helpers Keith Busch
2023-03-22 1:46 ` Chaitanya Kulkarni
2023-03-22 4:38 ` kernel test robot
2023-03-22 5:21 ` Chaitanya Kulkarni
2023-03-22 7:35 ` Sagi Grimberg
2023-03-22 8:27 ` Christoph Hellwig
2023-03-22 9:07 ` Sagi Grimberg
2023-03-22 9:25 ` kernel test robot
2023-03-22 0:23 ` [PATCH 2/3] nvme: add polling options for loop target Keith Busch
2023-03-22 1:47 ` Chaitanya Kulkarni
2023-03-22 7:44 ` Sagi Grimberg
2023-03-22 8:23 ` Christoph Hellwig
2023-03-22 8:46 ` Daniel Wagner
2023-03-22 13:52 ` Christoph Hellwig
2023-03-22 14:06 ` Daniel Wagner
2023-03-22 14:20 ` Christoph Hellwig
2023-03-22 14:30 ` Keith Busch
2023-03-22 0:23 ` Keith Busch [this message]
2023-03-22 7:36 ` [PATCH 3/3] blk-mq: directly poll requests Sagi Grimberg
2023-03-22 8:23 ` Christoph Hellwig
2023-03-22 9:08 ` Sagi Grimberg
2023-03-22 8:37 ` Daniel Wagner
2023-03-22 18:16 ` Chaitanya Kulkarni
2023-03-31 7:57 ` Shinichiro Kawasaki
2023-03-22 7:31 ` [PATCH 0/3] nvme fabrics polling fixes Sagi Grimberg
2023-03-22 8:48 ` Daniel Wagner
2023-03-22 13:24 ` Sagi Grimberg
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=20230322002350.4038048-4-kbusch@meta.com \
--to=kbusch@meta.com \
--cc=Martin.Belanger@dell.com \
--cc=axboe@kernel.dk \
--cc=dwagner@suse.de \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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