Skip to content

Commit 32a50fa

Browse files
Ming Leiaxboe
authored andcommitted
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]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent cd4a4ae commit 32a50fa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

block/blk-mq-sched.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e)
585585

586586
if (!e) {
587587
q->elevator = NULL;
588+
q->nr_requests = q->tag_set->queue_depth;
588589
return 0;
589590
}
590591

0 commit comments

Comments
 (0)