block/mq-deadline: add prio_enable switch and harden prio_aging_expire
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest4 patches 0 repliesNew
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | block/mq-deadline: reject zero prio_aging_expireblock/ | +26 | 0 replies | |
| 2/4 | block/mq-deadline: add prio_enable switch for I/O priority controlblock/ | +82 | 0 replies | |
| 3/4 | block/mq-deadline: add module parameter for prio_enableblock/ | +12 | 0 replies | |
| 4/4 | docs: block: document prio_enable and prio_aging_expire in deadline-ioschedDocumentation/ | +32 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/4] block/mq-deadline: add prio_enable switch and harden prio_aging_expire
From: Ye Bin <[email protected]>
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(-)
Signature · 1 line
2.34.1