block/mq-deadline: add prio_enable switch and harden prio_aging_expire - #1245
Open
blktests-ci[bot] wants to merge 4 commits into
Open
block/mq-deadline: add prio_enable switch and harden prio_aging_expire#1245blktests-ci[bot] wants to merge 4 commits into
blktests-ci[bot] wants to merge 4 commits into
Conversation
Author
|
Upstream branch: ba285ed Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/series/1154425/ conflict: |
added 4 commits
September 8, 2026 15:49
A prio_aging_expire of zero does not disable I/O priority in mq-deadline. Instead the priority aging path in dd_dispatch_prio_aged_requests() is invoked with "now - 0 == now", which causes best-effort and idle requests to be dispatched ahead of pending real-time requests -- a classic priority inversion, not the "priority disabled" behavior users may expect when writing zero. Reject zero (and negative) values in the sysfs store with -EINVAL so that a misconfiguration is reported rather than silently accepted. Signed-off-by: Ye Bin <yebin10@huawei.com>
Since mq-deadline introduced support for I/O priorities, processes without an explicit I/O priority are bound to their scheduling priority. This forces applications to plan their I/O priorities, but many applications do not care about I/O priorities and have no way to disable the distinction. Add a per-queue prio_enable boolean to control whether I/O priority (RT/BE/IDLE) support is active. When disabled, every request is filed in the best-effort bucket and the priority aging path is bypassed. To avoid priority inversion while toggling the switch at runtime, the sysfs store follows the same sequence as elevator_switch(): freeze the queue, quiesce, flip the flag, then unquiesce and unfreeze. This drains in-flight I/O so that requests already queued in RT or IDLE buckets complete before the mode changes. Since requests may now be filed in a bucket that does not match their ioprio, update dd_start_request(), dd_request_merged() and dd_merged_requests() to look up the per-priority bucket from rq->elv.priv[0] instead of recomputing it from the request ioprio. Remove the now-unused dd_rq_ioclass() helper. Signed-off-by: Ye Bin <yebin10@huawei.com>
Allow the default of prio_enable to be overridden at load time: - built-in: mq_deadline.prio_enable=0 on the kernel command line - module: modprobe mq_deadline prio_enable=0 A value of zero disables I/O priority from boot/load: every request is filed in the best-effort bucket and the priority aging path is bypassed, so systems that do not want RT/BE/IDLE distinction can opt out without writing to sysfs after every queue creation. Signed-off-by: Ye Bin <yebin10@huawei.com>
…osched
The mq-deadline scheduler exposes two sysfs tunables, prio_enable and
prio_aging_expire, that control its I/O priority (RT/BE/IDLE) support,
but neither was described in the deadline-iosched documentation.
Add sections covering:
- prio_enable: enables/disables RT/BE/IDLE distinction; when disabled
all requests fall into the best-effort bucket and the priority aging
path is bypassed. Switching the value drains in-flight I/O (queue
freeze and quiesce) to avoid priority inversion during the transition.
Also available as a module parameter.
- prio_aging_expire: the time after which a waiting best-effort or idle
request may be dispatched despite pending real-time requests, to
prevent indefinite starvation. Defaults to 10000 ms; only effective
when prio_enable is on and at least two priority buckets are
populated. Zero and negative values are rejected with -EINVAL to
avoid the "now - 0 == now" priority inversion.
Signed-off-by: Ye Bin <yebin10@huawei.com>
Author
|
Upstream branch: ba285ed |
blktests-ci
Bot
force-pushed
the
series/1154425=>for-next
branch
from
September 8, 2026 15:50
38d2064 to
c7504ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: block/mq-deadline: add prio_enable switch and harden prio_aging_expire
version: 2
url: https://patchwork.kernel.org/series/1154425/