kresults

← Back

block: make changing to the current I/O scheduler cheap again

v7.4-rc3-151-ge7ae9945768d

Author
Qiliang Yuan <qiliang.yuan@linux.dev>
Date
Tue, 17 Nov 2026 02:56:53 +0000
Change-id
20261111-bug-block-elevator-unchanged-a6cd2d761d38
Thread
20261116-bug-block-elevator-unchanged-v3-0-cb4dda2dadf4@linux.dev
Mailing lists
LKMLlinux-block
Ref
b4/20261116-bug-block-elevator-unchanged-v3-0-cb4dda2dadf4
Patches
2
Base
v7.4-rc3-149-g666539eecdf4 666539eecdf4
Report
report.txt
Producer
kdevops-ng 04cc1ca, kdevops-ng ae15187, kdevops-ng b1987d2, kdevops-ng d21d96d

Cover letter

41 lines
Writing the scheduler a queue already uses to queue/scheduler takes
about 10 ms and freezes the queue, which stalls I/O on live disks every
time a udev rule or tuning tool sets the scheduler unconditionally.

Patch 1 stops requesting a "none-iosched" module on every write of
"none". Patch 2 returns before freezing the queue when the elevator
wouldn't change.

On a null_blk disk (median of 20 writes, all kernels measured in the
same run):

  operation                   base (ms)  patch 1 (ms)  patch 1+2 (ms)
  none -> none                    13.10          9.11            0.08
  mq-deadline -> mq-deadline      10.95          9.05            0.08
  mq-deadline -> none             13.00          7.97            6.03

Signed-off-by: Qiliang Yuan <qiliang.yuan@linux.dev>
---
V2 -> V3:
- Point Fixes in patch 2 at the commit that added the freeze, as
  Christoph pointed out
- Add Christoph's Reviewed-by to patch 2
- Rebase onto v7.4-rc2-1025-g666539eecdf4

V1 -> V2:
- Keep the elevator check under the freeze and note the race in the
  comment, as Christoph suggested
- Say "change" instead of "rewrite" in the cover letter subject
- Rebase onto v7.4-rc2-470-g7e1392a42ea2 and update the numbers from a
  new run

v2: https://lore.kernel.org/r/20261114-bug-block-elevator-unchanged-v2-0-5a1fe7d72fa0@linux.dev
v1: https://lore.kernel.org/r/20261111-bug-block-elevator-unchanged-v1-0-583198bd4e21@linux.dev

---
Qiliang Yuan (2):
      block: don't request a module for the none elevator
      block: return early when the elevator doesn't change

 block/elevator.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Patches

PatchSubjectAuthorCommit
1/2block: don't request a module for the none elevatorQiliang Yuan <qiliang.yuan@linux.dev>c8095b5f2558
2/2block: return early when the elevator doesn't changeQiliang Yuan <qiliang.yuan@linux.dev>e7ae9945768d

Builds

ConfigurationArchCompilerFindingsRecordedProducer
no buildcheckpatch.pl ✓2026-11-21 20:51kdevops-ng b1987d2
blktests, block-layer, guest, nvm-express-driverx86_64gccmerge_config.sh ✓ make ✓ blktests 3 12 21 +11 −1 sparse ✓ smatch ✓2026-11-23 08:40kdevops-ng 04cc1ca, kdevops-ng ae15187, kdevops-ng b1987d2, kdevops-ng d21d96d

b4

What b4 printed applying the series: how it came to the base, and each base the series would not apply onto first.

Looking up 20261116-bug-block-elevator-unchanged-v3-0-cb4dda2dadf4@linux.dev
Checking for newer revisions
Grabbing search results from lore.kernel.org
Analyzing 6 messages in the thread
Looking for additional code-review trailers on lore.kernel.org
Analyzing 13 code-review messages
Checking attestation on all messages, may take a moment...
---
  ✓ [PATCH v3 1/2] block: don't request a module for the none elevator
    + Reviewed-by: Hannes Reinecke <hare@kernel.org> (✓ DKIM/suse.de)
    + Link: https://patch.msgid.link/20261116-bug-block-elevator-unchanged-v3-1-cb4dda2dadf4@linux.dev
  ✓ [PATCH v3 2/2] block: return early when the elevator doesn't change
    + Reviewed-by: Nilay Shroff <nilay@linux.ibm.com> (✓ DKIM/ibm.com)
    + Reviewed-by: Hannes Reinecke <hare@kernel.org> (✓ DKIM/suse.de)
    + Link: https://patch.msgid.link/20261116-bug-block-elevator-unchanged-v3-2-cb4dda2dadf4@linux.dev
  ---
  ✓ Signed: DKIM/linux.dev
---
Total patches: 2
---
 Base: 666539eecdf4db623f5e3c3e55cf9f2dfad24aa4 (use --merge-base to override)
Magic: Preparing a sparse worktree
---
Applying: block: don't request a module for the none elevator
Applying: block: return early when the elevator doesn't change
---
Fetching into FETCH_HEAD
You can now merge or checkout FETCH_HEAD
  e.g.: git merge --no-ff -F .git/b4-cover --no-edit FETCH_HEAD --signoff