diff options
author | Ming Lei <ming.lei@redhat.com> | 2018-02-23 10:36:56 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-02-24 17:55:54 -0500 |
commit | 105976f517791aed3b11f8f53b308a2069d42055 (patch) | |
tree | 2c3d09d3f0e2495be37f67b29f45a5ca19089bf2 | |
parent | 0bd1ed4860d0f5f836aa8371797689a3779d1bf5 (diff) |
blk-mq: don't call io sched's .requeue_request when requeueing rq to ->dispatch
__blk_mq_requeue_request() covers two cases:
- one is that the requeued request is added to hctx->dispatch, such as
blk_mq_dispatch_rq_list()
- another case is that the request is requeued to io scheduler, such as
blk_mq_requeue_request().
We should call io sched's .requeue_request callback only for the 2nd
case.
Cc: Paolo Valente <paolo.valente@linaro.org>
Cc: Omar Sandoval <osandov@fb.com>
Fixes: bd166ef183c2 ("blk-mq-sched: add framework for MQ capable IO schedulers")
Cc: stable@vger.kernel.org
Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com>
Acked-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | block/blk-mq.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 357492712b0e..16e83e6df404 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -712,7 +712,6 @@ static void __blk_mq_requeue_request(struct request *rq) | |||
712 | 712 | ||
713 | trace_block_rq_requeue(q, rq); | 713 | trace_block_rq_requeue(q, rq); |
714 | wbt_requeue(q->rq_wb, &rq->issue_stat); | 714 | wbt_requeue(q->rq_wb, &rq->issue_stat); |
715 | blk_mq_sched_requeue_request(rq); | ||
716 | 715 | ||
717 | if (blk_mq_rq_state(rq) != MQ_RQ_IDLE) { | 716 | if (blk_mq_rq_state(rq) != MQ_RQ_IDLE) { |
718 | blk_mq_rq_update_state(rq, MQ_RQ_IDLE); | 717 | blk_mq_rq_update_state(rq, MQ_RQ_IDLE); |
@@ -725,6 +724,9 @@ void blk_mq_requeue_request(struct request *rq, bool kick_requeue_list) | |||
725 | { | 724 | { |
726 | __blk_mq_requeue_request(rq); | 725 | __blk_mq_requeue_request(rq); |
727 | 726 | ||
727 | /* this request will be re-inserted to io scheduler queue */ | ||
728 | blk_mq_sched_requeue_request(rq); | ||
729 | |||
728 | BUG_ON(blk_queued_rq(rq)); | 730 | BUG_ON(blk_queued_rq(rq)); |
729 | blk_mq_add_to_requeue_list(rq, true, kick_requeue_list); | 731 | blk_mq_add_to_requeue_list(rq, true, kick_requeue_list); |
730 | } | 732 | } |