Skip to content

Commit dad7a3b

Browse files
Ming Leiaxboe
authored andcommitted
blk-mq: pass correct hctx to blk_mq_try_issue_directly
When direct issue is done on request picked up from plug list, the hctx need to be updated with the actual hw queue, otherwise wrong hctx is used and may hurt performance, especially when wrong SRCU readlock is acquired/released Reported-by: Bart Van Assche <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 3116a23 commit dad7a3b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

block/blk-mq.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,9 +1619,12 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
16191619

16201620
blk_mq_put_ctx(data.ctx);
16211621

1622-
if (same_queue_rq)
1622+
if (same_queue_rq) {
1623+
data.hctx = blk_mq_map_queue(q,
1624+
same_queue_rq->mq_ctx->cpu);
16231625
blk_mq_try_issue_directly(data.hctx, same_queue_rq,
16241626
&cookie);
1627+
}
16251628
} else if (q->nr_hw_queues > 1 && is_sync) {
16261629
blk_mq_put_ctx(data.ctx);
16271630
blk_mq_bio_to_request(rq, bio);

0 commit comments

Comments
 (0)