Re: [PATCH 1/2] block: don't request a module for the none elevator

From: Nilay Shroff

Date: Fri Nov 13 2026 - 07:51:37 EST


On 11/12/26 8:30 AM, Qiliang Yuan wrote:
elv_iosched_store() calls elv_iosched_load_module() for the requested
name before anything else, and loads "<name>-iosched" if no elevator
type of that name is registered. "none" never is, so every write of
"none" to queue/scheduler ends up in request_module("none-iosched").

That runs a modprobe helper which can never find the module, and adds
several milliseconds to every switch to "none", including rewrites of
it by udev rules or tuning tools that set the scheduler on each disk.

Return early for "none", like elevator_change() did before the module
loading moved into elv_iosched_load_module().

Writing queue/scheduler of a null_blk disk 20 times takes (median):

operation before (ms) after (ms) change
none -> none 13.09 9.06 -31%
mq-deadline -> none 11.99 7.96 -34%

Fixes: 734e1a8603128 ("block: Prevent deadlocks when switching elevators")
Signed-off-by: Qiliang Yuan<qiliang.yuan@xxxxxxxxx>

Looks good to me:

Reviewed-by: Nilay Shroff <nilay@xxxxxxxxxxxxx>