aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2017-06-06 11:21:59 -0400
committerJens Axboe <axboe@fb.com>2017-06-06 12:00:33 -0400
commitdad7a3be4960e5545882a0cd8d7613af22874314 (patch)
tree6f4581ccceff280457f476b79ac7645d2a8df5c7
parent3116a23bb30272d74ea81baf5d0ee23f602dd15b (diff)
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 <bart.vanassche@sandisk.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--block/blk-mq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 1bcccedcc74f..4ddfa019face 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1619,9 +1619,12 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
1619 1619
1620 blk_mq_put_ctx(data.ctx); 1620 blk_mq_put_ctx(data.ctx);
1621 1621
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);
1623 blk_mq_try_issue_directly(data.hctx, same_queue_rq, 1625 blk_mq_try_issue_directly(data.hctx, same_queue_rq,
1624 &cookie); 1626 &cookie);
1627 }
1625 } else if (q->nr_hw_queues > 1 && is_sync) { 1628 } else if (q->nr_hw_queues > 1 && is_sync) {
1626 blk_mq_put_ctx(data.ctx); 1629 blk_mq_put_ctx(data.ctx);
1627 blk_mq_bio_to_request(rq, bio); 1630 blk_mq_bio_to_request(rq, bio);