On Wed, May 30, 2018 at 06:22:04AM +0000, Damien Le Moal wrote: > That would necessitate splitting elevator_init() into a generic elevator > initialization function setting up the elevator related fields of the > request queue and a second part setting up the default elevator (e.g. > elevator_set_default()). Doing so, the function elevator_set_default() > could be called later in the device initialization sequence, after > information from the device has been obtained. It would make choosing a > sane default elevator much cleaner.
For blk-mq this makes entirely sense, untested series here: http://git.infradead.org/users/hch/block.git/shortlog/refs/heads/elevator_init For the legacy case we always need at least some I/O scheduler, so we can't just defer it. But I think we could still switch to deadline in blk_register_queue if we found a zoned device.