diff options
author | Christoph Hellwig <hch@lst.de> | 2021-10-19 14:25:53 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-19 19:10:09 +0200 |
commit | d92ca9d8348fb12c89eac5928bd651c3a485d7b9 (patch) | |
tree | 05d9098b647cd912977e1f87fa297fd9c543ffde /block/blk-mq.c | |
parent | block: attempt direct issue of plug list (diff) | |
download | linux-d92ca9d8348fb12c89eac5928bd651c3a485d7b9.tar.xz linux-d92ca9d8348fb12c89eac5928bd651c3a485d7b9.zip |
blk-mq: don't handle non-flush requests in blk_insert_flush
Return to the normal blk_mq_submit_bio flow if the bio did not end up
actually being a flush because the device didn't support it. Note that
this is basically impossible to hit without special instrumentation given
that submit_bio_checks already clears these flags usually, so we'd need a
tight race to actually hit this code path.
With this the call to blk_mq_run_hw_queue for the flush requests can be
removed given that the actual flush requests are always issued via the
requeue workqueue which runs the queue unconditionally.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211019122553.2467817-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 71ab7521dd3d..3481a8712234 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2532,14 +2532,12 @@ void blk_mq_submit_bio(struct bio *bio) return; } - if (unlikely(is_flush_fua)) { - struct blk_mq_hw_ctx *hctx = rq->mq_hctx; - /* Bypass scheduler for flush requests */ - blk_insert_flush(rq); - blk_mq_run_hw_queue(hctx, true); - } else if (plug && (q->nr_hw_queues == 1 || - blk_mq_is_shared_tags(rq->mq_hctx->flags) || - q->mq_ops->commit_rqs || !blk_queue_nonrot(q))) { + if (is_flush_fua && blk_insert_flush(rq)) + return; + + if (plug && (q->nr_hw_queues == 1 || + blk_mq_is_shared_tags(rq->mq_hctx->flags) || + q->mq_ops->commit_rqs || !blk_queue_nonrot(q))) { /* * Use plugging if we have a ->commit_rqs() hook as well, as * we know the driver uses bd->last in a smart fashion. |