Skip to contentSkip to conversation

blk-mq: put driver tag if dispatch budget can't be got

PATCH Applied Ming Lei 2 participants 2 messages Nov 8, 2017 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH v2 1/1 blk-mq: put driver tag if dispatch budget can't be got

We have to put the driver tag if dispatch budget can't be got, otherwise it might cause IO deadlock, especially in case that size of tags is very small.

Fixes de1482974080(blk-mq: introduce .get_budget and .put_budget in blk_mq_ops)

---
V2:
add Fixes tag

 block/blk-mq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
block/blk-mq.c +3 -1
index c501cbd0de93..3d759bb8a5bb 100644
@@ -1080,8 +1080,10 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
 			}
 		}
 
-		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;
+		}
 
 		list_del_init(&rq->queuelist);
 
Signature · 1 line
2.9.5
Applied
#1 lore raw
Quoted 3 lines · Ming Lei

We have to put the driver tag if dispatch budget can't be got, otherwise it might cause IO deadlock, especially in case that size of tags is very small.

Applied, thanks.

Signature · 1 line
Jens Axboe