Linux block layer
 help / color / mirror / Atom feed
* [PATCH v2 0/4] block/mq-deadline: add prio_enable switch and harden prio_aging_expire
@ 2026-08-31 11:01 Ye Bin
  2026-08-31 11:01 ` [PATCH v2 1/4] block/mq-deadline: reject zero prio_aging_expire Ye Bin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ye Bin @ 2026-08-31 11:01 UTC (permalink / raw)
  To: axboe, linux-block; +Cc: ming.lei

From: Ye Bin <yebin10@huawei.com>

v2 diff vs v1:
1. Rejects zero and negative prio_aging_expire values with -EINVAL.
2. Introduce a per-queue prio_enable boolean sysfs attribute to disable
io priority.
3. Adds a module parameter prio_enable to disable io priority.
4. Documents both prio_enable and prio_aging_expire in
Documentation/block/deadline-iosched.rst.

This series adds a way to disable I/O priority (RT/BE/IDLE) distinction
in the mq-deadline scheduler and hardens the prio_aging_expire tunable
to prevent priority inversion.

Since mq-deadline introduced support for I/O priorities, processes
without an explicit I/O priority are bound to their scheduling priority.
Many applications do not care about I/O priorities and have no way to
disable the distinction, which adds overhead and can cause unexpected
latency behaviour.  This series gives operators a per-queue sysfs
switch (and a module parameter default) to opt out of the RT/BE/IDLE
classification entirely.

Patch 1 rejects zero and negative prio_aging_expire values with
-EINVAL.  A value of zero does not disable I/O priority; instead the
priority aging path in dd_dispatch_prio_aged_requests() is invoked with
"now - 0 == now", which dispatches best-effort and idle requests ahead
of pending real-time requests -- a classic priority inversion.

Patch 2 adds a per-queue prio_enable boolean sysfs attribute.  When
disabled, every request is filed in the best-effort bucket and the
priority aging path is bypassed.  The sysfs store drains in-flight I/O
through queue freeze and quiesce (the same sequence used by
elevator_switch()) to avoid priority inversion while toggling at
runtime.  As requests may now be filed in a bucket that does not match
their ioprio, dd_start_request(), dd_request_merged() and
dd_merged_requests() are updated to look up the per-priority bucket
from rq->elv.priv[0] instead of recomputing it from the request ioprio;
the now-unused dd_rq_ioclass() helper is removed.

Patch 3 adds a module parameter prio_enable so the default can be
overridden at load time (mq_deadline.prio_enable=0 on the kernel
command line or modprobe mq_deadline prio_enable=0), letting systems
opt out of I/O priority from boot without writing to sysfs after every
queue creation.

Patch 4 documents both prio_enable and prio_aging_expire in
Documentation/block/deadline-iosched.rst.

Ye Bin (4):
  block/mq-deadline: reject zero prio_aging_expire
  block/mq-deadline: add prio_enable switch for I/O priority control
  block/mq-deadline: add module parameter for prio_enable
  docs: block: document prio_enable and prio_aging_expire in
    deadline-iosched

 Documentation/block/deadline-iosched.rst |  32 +++++
 block/mq-deadline.c                      | 148 ++++++++++++++++++-----
 2 files changed, 151 insertions(+), 29 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-31 11:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 11:01 [PATCH v2 0/4] block/mq-deadline: add prio_enable switch and harden prio_aging_expire Ye Bin
2026-08-31 11:01 ` [PATCH v2 1/4] block/mq-deadline: reject zero prio_aging_expire Ye Bin
2026-08-31 11:01 ` [PATCH v2 2/4] block/mq-deadline: add prio_enable switch for I/O priority control Ye Bin
2026-08-31 11:01 ` [PATCH v2 3/4] block/mq-deadline: add module parameter for prio_enable Ye Bin
2026-08-31 11:01 ` [PATCH v2 4/4] docs: block: document prio_enable and prio_aging_expire in deadline-iosched Ye Bin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox