Skip to content

Commit

Permalink
blk-mq: update nr_requests when switching to 'none' scheduler
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Ming Lei authored and axboe committed Jun 3, 2018
1 parent cd4a4ae commit 32a50fa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/blk-mq-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 32a50fa

Please sign in to comment.