Linux block layer
 help / color / mirror / Atom feed
From: Ye Bin <yebin@huaweicloud.com>
To: axboe@kernel.dk, linux-block@vger.kernel.org
Cc: ming.lei@redhat.com
Subject: [PATCH v2 0/4] block/mq-deadline: add prio_enable switch and harden prio_aging_expire
Date: Mon, 31 Aug 2026 19:01:40 +0800	[thread overview]
Message-ID: <20260831110144.2648156-1-yebin@huaweicloud.com> (raw)

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


             reply	other threads:[~2026-08-31 11:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 11:01 Ye Bin [this message]
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

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=20260831110144.2648156-1-yebin@huaweicloud.com \
    --to=yebin@huaweicloud.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.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