[PATCH V2 3/5] blk-mq: don't update q->nr_requests when updating hw queue's depth

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In MQ scheduler, q->nr_requests represents requests in scheduler
queue depth, so don't update it if hw queue's depth is updated.

Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx>
---
 block/blk-mq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index be475ad112ec..681bf33d8de8 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2643,6 +2643,7 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr)
 	struct blk_mq_tag_set *set = q->tag_set;
 	struct blk_mq_hw_ctx *hctx;
 	int i, ret;
+	bool sched = false;
 
 	if (!set)
 		return -EINVAL;
@@ -2664,12 +2665,13 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr)
 		} else {
 			ret = blk_mq_tag_update_depth(hctx, &hctx->sched_tags,
 							nr, true);
+			sched = true;
 		}
 		if (ret)
 			break;
 	}
 
-	if (!ret)
+	if (!ret && sched)
 		q->nr_requests = nr;
 
 	blk_mq_unfreeze_queue(q);
-- 
2.9.3




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux