From: Hannes Reinecke <hare@suse.de>
To: Qiliang Yuan <qiliang.yuan@linux.dev>,
Jens Axboe <axboe@kernel.dk>, Damien Le Moal <dlemoal@kernel.org>,
Ming Lei <tom.leiming@gmail.com>,
Nilay Shroff <nilay@linux.ibm.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v3 1/2] block: don't request a module for the none elevator
Date: Tue, 17 Nov 2026 16:19:30 +0100 [thread overview]
Message-ID: <3d134488-d8ab-404b-bd0e-c9e68d6fad47@suse.de> (raw)
In-Reply-To: <20261116-bug-block-elevator-unchanged-v3-1-cb4dda2dadf4@linux.dev>
On 11/17/26 3:56 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.10 9.11 -30%
> mq-deadline -> none 13.00 7.97 -39%
>
> Fixes: 734e1a8603128 ("block: Prevent deadlocks when switching elevators")
> Signed-off-by: Qiliang Yuan <qiliang.yuan@linux.dev>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
> ---
> block/elevator.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/block/elevator.c b/block/elevator.c
> index 66edf1a5768a8..9d9b2e84a1288 100644
> --- a/block/elevator.c
> +++ b/block/elevator.c
> @@ -775,6 +775,9 @@ static void elv_iosched_load_module(const char *elevator_name)
> {
> struct elevator_type *found;
>
> + if (!strncmp(elevator_name, "none", 4))
> + return;
> +
> spin_lock(&elv_list_lock);
> found = __elevator_find(elevator_name);
> spin_unlock(&elv_list_lock);
>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
next prev parent reply other threads:[~2026-11-17 15:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 2:56 [PATCH v3 0/2] block: make changing to the current I/O scheduler cheap again Qiliang Yuan
2026-11-17 2:56 ` [PATCH v3 1/2] block: don't request a module for the none elevator Qiliang Yuan
2026-11-17 15:19 ` Hannes Reinecke [this message]
2026-11-17 2:56 ` [PATCH v3 2/2] block: return early when the elevator doesn't change Qiliang Yuan
2026-11-17 14:54 ` Nilay Shroff
2026-11-17 15:20 ` Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d134488-d8ab-404b-bd0e-c9e68d6fad47@suse.de \
--to=hare@suse.de \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nilay@linux.ibm.com \
--cc=qiliang.yuan@linux.dev \
--cc=tom.leiming@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®