summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2018-06-02 15:18:09 +0800
committerJens Axboe <axboe@kernel.dk>2018-06-02 20:35:00 -0600
commit32a50fabb334b2f0725de84bf248bd8c24c22b05 (patch)
tree89553605d21f60fb213d20b5137bb19169bc333f /block
parentcd4a4ae4683dc2e09380118e205e057896dcda2b (diff)
downloadlinux-32a50fabb334b2f0725de84bf248bd8c24c22b05.tar.gz
linux-32a50fabb334b2f0725de84bf248bd8c24c22b05.tar.bz2
linux-32a50fabb334b2f0725de84bf248bd8c24c22b05.zip
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 <mpatalan@redhat.com> Cc: "Ewan D. Milne" <emilne@redhat.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq-sched.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index b1f06088cee5..56c493c6cd90 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -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;
}