Skip to contentSkip to conversation

blk-mq: update nr_requests when switching to 'none' scheduler

PATCH In review Ming Lei 2 participants 2 messages Jun 2, 2018 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 blk-mq: update nr_requests when switching to 'none' scheduler

Now we setup q->nr_requests when switching to one new scheduler, but not do it for 'none', then q->nr_requests may not be correct for 'none'.

This patch fixes this issue by always updating 'nr_requests' when switching to 'none'.

Cc Marco Patalano <[email protected]>
Cc "Ewan D. Milne" <[email protected]>
---
 block/blk-mq-sched.c | 1 +
 1 file changed, 1 insertion(+)
block/blk-mq-sched.c +1 -0
index b0f2c2a40a0c..b087d8884a08 100644
@@ -585,6 +585,7 @@ int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e)
 
 	if (!e) {
 		q->elevator = NULL;
+		q->nr_requests = q->tag_set->queue_depth;
 		return 0;
 	}
 
Signature · 1 line
2.9.5
maintainer
#1 lore raw
Quoted 6 lines · Ming Lei

Now we setup q->nr_requests when switching to one new scheduler, but not do it for 'none', then q->nr_requests may not be correct for 'none'.

This patch fixes this issue by always updating 'nr_requests' when switching to 'none'.

Looks fine, applied.

Signature · 1 line
Jens Axboe