block: Improve default elevator selection
authorDamien Le Moal <damien.lemoal@wdc.com>
Thu, 5 Sep 2019 09:51:32 +0000 (18:51 +0900)
committerJens Axboe <axboe@kernel.dk>
Fri, 6 Sep 2019 01:52:34 +0000 (19:52 -0600)
commita0958ba7fcdc316e3900f8d2afda519850d60985
tree6a8167c62b6a585670ffaf11a37e10cf06e2f953
parent68c43f133a754c7bf5cb1018bb16dc0821cc43a1
block: Improve default elevator selection

For block devices that do not specify required features, preserve the
current default elevator selection (mq-deadline for single queue
devices, none for multi-queue devices). However, for devices specifying
required features (e.g. zoned block devices ELEVATOR_F_ZBD_SEQ_WRITE
feature), select the first available elevator providing the required
features.

In all cases, default to "none" if no elevator is available or if the
initialization of the default elevator fails.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/elevator.c