diff options
author | Ming Lei <ming.lei@redhat.com> | 2017-06-06 23:21:59 +0800 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-06-06 10:00:33 -0600 |
commit | dad7a3be4960e5545882a0cd8d7613af22874314 (patch) | |
tree | 6f4581ccceff280457f476b79ac7645d2a8df5c7 /block | |
parent | 3116a23bb30272d74ea81baf5d0ee23f602dd15b (diff) | |
download | op-kernel-dev-dad7a3be4960e5545882a0cd8d7613af22874314.zip op-kernel-dev-dad7a3be4960e5545882a0cd8d7613af22874314.tar.gz |
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>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 1bccced..4ddfa01 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) blk_mq_put_ctx(data.ctx); - if (same_queue_rq) + if (same_queue_rq) { + data.hctx = blk_mq_map_queue(q, + same_queue_rq->mq_ctx->cpu); blk_mq_try_issue_directly(data.hctx, same_queue_rq, &cookie); + } } else if (q->nr_hw_queues > 1 && is_sync) { blk_mq_put_ctx(data.ctx); blk_mq_bio_to_request(rq, bio); |