diff options
author | Jens Axboe <axboe@fb.com> | 2017-01-13 14:43:58 -0700 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-01-17 10:04:31 -0700 |
commit | d34849913819a5e0cbfbe724dbe79df89278c524 (patch) | |
tree | 71b427fa3b22b30dc2038448ec06936018adaee4 /block/elevator.c | |
parent | 945ffb60c11dfb228130f3f2bdde961cecb76671 (diff) |
blk-mq-sched: allow setting of default IO scheduler
Add Kconfig entries to manage what devices get assigned an MQ
scheduler, and add a blk-mq flag for drivers to opt out of scheduling.
The latter is useful for admin type queues that still allocate a blk-mq
queue and tag set, but aren't use for normal IO.
Signed-off-by: Jens Axboe <axboe@fb.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/block/elevator.c b/block/elevator.c index 0e1ccddab8a2..bcba2dd5cb5c 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -219,7 +219,13 @@ int elevator_init(struct request_queue *q, char *name) } if (!e) { - e = elevator_get(CONFIG_DEFAULT_IOSCHED, false); + if (q->mq_ops && q->nr_hw_queues == 1) + e = elevator_get(CONFIG_DEFAULT_SQ_IOSCHED, false); + else if (q->mq_ops) + e = elevator_get(CONFIG_DEFAULT_MQ_IOSCHED, false); + else + e = elevator_get(CONFIG_DEFAULT_IOSCHED, false); + if (!e) { printk(KERN_ERR "Default I/O scheduler not found. " \ |