Skip to contentSkip to conversation

blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly

PATCH 胡海 1 participant 1 message May 16, 2018 Block layer

lore
Share & tools
lore

胡海

author
#0 lore raw
Author: huhai <[email protected]>
Date:   Wed May 16 10:34:22 2018 +0800

blk-mq: for sync case, whether it is mq or sq make_request instances, we should send the request directly

For sq make_request instances, we should issue sync request directly too, otherwise it will break down the semantics of sync request, the current code logic is to send synchronous requests asynchronously.

block/blk-mq.c +1 -1
index 5629f18..fcf2f16 100644
@@ -1771,7 +1771,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
                        blk_mq_try_issue_directly(data.hctx, same_queue_rq,
                                        &cookie);
                }
-       } else if (q->nr_hw_queues > 1 && is_sync) {
+       } else if (is_sync) {
                blk_mq_put_ctx(data.ctx);
                blk_mq_bio_to_request(rq, bio);
                blk_mq_try_issue_directly(data.hctx, rq, &cookie);