Signed-off-by: John Garry<john.garry@xxxxxxxxxx>Below this code, there is:
---
block/blk-mq.c | 4 +++-
drivers/scsi/scsi_lib.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 260adeb2e455..d8baabb32ea4 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1955,11 +1955,13 @@ bool blk_mq_dispatch_rq_list(struct blk_mq_hw_ctx *hctx, struct list_head *list,
errors = queued = 0;
do {
struct blk_mq_queue_data bd;
+ bool need_budget;
rq = list_first_entry(list, struct request, queuelist);
WARN_ON_ONCE(hctx != rq->mq_hctx);
- prep = blk_mq_prep_dispatch_rq(rq, !nr_budgets);
+ need_budget = !nr_budgets && !blk_mq_is_reserved_rq(rq);
+ prep = blk_mq_prep_dispatch_rq(rq, need_budget);
if (prep != PREP_DISPATCH_OK)
break;
if (nr_budgets)
nr_budgets--;
Don't you need to change that to:
if (need_budget && nr_budgets)
nr_budgets--;
? Otherwise, the accounting will be off.