public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] blk-mq: Put driver tag in blk_mq_dispatch_rq_list() when no budget
@ 2020-04-16 11:18 John Garry
  2020-04-16 14:12 ` Ming Lei
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: John Garry @ 2020-04-16 11:18 UTC (permalink / raw)
  To: axboe; +Cc: linux-block, linux-kernel, ming.lei, John Garry

If in blk_mq_dispatch_rq_list() we find no budget, then we break of the
dispatch loop, but the request may keep the driver tag, evaulated
in 'nxt' in the previous loop iteration.

Fix by putting the driver tag for that request.

Signed-off-by: John Garry <john.garry@huawei.com>

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 8e56884fd2e9..a7785df2c944 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1222,8 +1222,10 @@ 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;
-		if (!got_budget && !blk_mq_get_dispatch_budget(hctx))
+		if (!got_budget && !blk_mq_get_dispatch_budget(hctx)) {
+			blk_mq_put_driver_tag(rq);
 			break;
+		}
 
 		if (!blk_mq_get_driver_tag(rq)) {
 			/*
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-04-24  7:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-16 11:18 [PATCH] blk-mq: Put driver tag in blk_mq_dispatch_rq_list() when no budget John Garry
2020-04-16 14:12 ` Ming Lei
2020-04-16 15:27 ` Jens Axboe
2020-04-18  2:43 ` Bart Van Assche
2020-04-20  8:22   ` John Garry
2020-04-20 12:48     ` Bart Van Assche
2020-04-23 22:42     ` Doug Anderson
2020-04-24  1:35       ` Ming Lei
2020-04-24  7:18         ` John Garry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox