Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
blk-mq: don't call io sched's .requeue_request when requeueing rq to …
Browse files Browse the repository at this point in the history
…->dispatch

commit 105976f upstream.

__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 <[email protected]>
Cc: Omar Sandoval <[email protected]>
Fixes: bd166ef ("blk-mq-sched: add framework for MQ capable IO schedulers")
Cc: [email protected]
Reviewed-by: Bart Van Assche <[email protected]>
Acked-by: Paolo Valente <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Ming Lei authored and gregkh committed Mar 9, 2018
1 parent c5f3246 commit ccddee8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,6 @@ static void __blk_mq_requeue_request(struct request *rq)

trace_block_rq_requeue(q, rq);
wbt_requeue(q->rq_wb, &rq->issue_stat);
blk_mq_sched_requeue_request(rq);

if (test_and_clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags)) {
if (q->dma_drain_size && blk_rq_bytes(rq))
Expand All @@ -650,6 +649,9 @@ void blk_mq_requeue_request(struct request *rq, bool kick_requeue_list)
{
__blk_mq_requeue_request(rq);

/* this request will be re-inserted to io scheduler queue */
blk_mq_sched_requeue_request(rq);

BUG_ON(blk_queued_rq(rq));
blk_mq_add_to_requeue_list(rq, true, kick_requeue_list);
}
Expand Down

0 comments on commit ccddee8

Please sign in to comment.