summaryrefslogtreecommitdiffstats
path: root/block/blk-mq.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2020-06-30 12:24:57 +0200
committerJens Axboe <axboe@kernel.dk>2020-06-30 15:51:48 +0200
commit445874e89f662c8c6a56e6bb820cbe9fbef61428 (patch)
tree9bd7fd755f9b0dcc528ac5887689e56aadfb3ad2 /block/blk-mq.c
parentblk-mq: pass request queue into get/put budget callback (diff)
downloadlinux-445874e89f662c8c6a56e6bb820cbe9fbef61428.tar.xz
linux-445874e89f662c8c6a56e6bb820cbe9fbef61428.zip
blk-mq: pass hctx to blk_mq_dispatch_rq_list
All requests in the 'list' of blk_mq_dispatch_rq_list belong to same hctx, so it is better to pass hctx instead of request queue, because blk-mq's dispatch target is hctx instead of request queue. Signed-off-by: Ming Lei <ming.lei@redhat.com> Tested-by: Baolin Wang <baolin.wang7@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Cc: Sagi Grimberg <sagi@grimberg.me> Cc: Baolin Wang <baolin.wang7@gmail.com> Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r--block/blk-mq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 8cdc868f4249..492aeda44da6 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1258,10 +1258,10 @@ static void blk_mq_handle_zone_resource(struct request *rq,
/*
* Returns true if we did some work AND can potentially do more.
*/
-bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
+bool blk_mq_dispatch_rq_list(struct blk_mq_hw_ctx *hctx, struct list_head *list,
bool got_budget)
{
- struct blk_mq_hw_ctx *hctx;
+ struct request_queue *q = hctx->queue;
struct request *rq, *nxt;
bool no_tag = false;
int errors, queued;
@@ -1283,7 +1283,7 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
rq = list_first_entry(list, struct request, queuelist);
- hctx = rq->mq_hctx;
+ WARN_ON_ONCE(hctx != rq->mq_hctx);
if (!got_budget && !blk_mq_get_dispatch_budget(q)) {
blk_mq_put_driver_tag(rq);
no_budget_avail = true;