]> www.infradead.org Git - nvme.git/commit
elevator: do not request_module if elevator exists
authorBreno Leitao <leitao@debian.org>
Fri, 11 Oct 2024 17:01:21 +0000 (10:01 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 11 Oct 2024 17:10:52 +0000 (11:10 -0600)
commitb4ff6e93bfd0093ce3ffc7322e89fbaa8300488f
tree8bb653c8fdd424c0c5317d216955b519a96d2790
parent1e3fc2000035ffea0b1b7ec2423706715ab2e7f6
elevator: do not request_module if elevator exists

Whenever an I/O elevator is changed, the system attempts to load a
module for the new elevator. This occurs regardless of whether the
elevator is already loaded or built directly into the kernel. This
behavior introduces unnecessary overhead and potential issues.

This makes the operation slower, and more error-prone. For instance,
making the problem fixed by [1] visible for users that doesn't even rely
on modules being available through modules.

Do not try to load the ioscheduler if it is already visible.

This change brings two main benefits: it improves the performance of
elevator changes, and it reduces the likelihood of errors occurring
during this process.

[1] Commit e3accac1a976 ("block: Fix elv_iosched_local_module handling of "none" scheduler")

Fixes: 734e1a860312 ("block: Prevent deadlocks when switching elevators")
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/r/20241011170122.3880087-1-leitao@debian.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/elevator.c