Skip to content

Commit 38a8c4d

Browse files
keithbuschaxboe
authored andcommitted
blk-mq: directly poll requests
Polling needs a bio with a valid bi_bdev, but neither of those are guaranteed for polled driver requests. Make request based polling directly use blk-mq's polling function instead. When executing a request from a polled hctx, we know the request's cookie, and that it's from a live blk-mq queue that supports polling, so we can safely skip everything that bio_poll provides. Cc: [email protected] Reported-by: Martin Belanger <[email protected]> Reported-by: Daniel Wagner <[email protected]> Signed-off-by: Keith Busch <[email protected]> Tested-by: Daniel Wagner <[email protected]> Revieded-by: Daniel Wagner <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Tested-by: Shin'ichiro Kawasaki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 24ab70d commit 38a8c4d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

block/blk-mq.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,16 +1359,14 @@ bool blk_rq_is_poll(struct request *rq)
13591359
return false;
13601360
if (rq->mq_hctx->type != HCTX_TYPE_POLL)
13611361
return false;
1362-
if (WARN_ON_ONCE(!rq->bio))
1363-
return false;
13641362
return true;
13651363
}
13661364
EXPORT_SYMBOL_GPL(blk_rq_is_poll);
13671365

13681366
static void blk_rq_poll_completion(struct request *rq, struct completion *wait)
13691367
{
13701368
do {
1371-
bio_poll(rq->bio, NULL, 0);
1369+
blk_mq_poll(rq->q, blk_rq_to_qc(rq), NULL, 0);
13721370
cond_resched();
13731371
} while (!completion_done(wait));
13741372
}

0 commit comments

Comments
 (0)