From: Ye Bin <yebin@huaweicloud.com>
To: axboe@kernel.dk, linux-block@vger.kernel.org
Cc: ming.lei@redhat.com
Subject: [PATCH 2/2] block/mq-deadline: add module parameter for prio_aging_expire default
Date: Thu, 20 Aug 2026 10:12:46 +0800 [thread overview]
Message-ID: <20260820021246.2681624-3-yebin@huaweicloud.com> (raw)
In-Reply-To: <20260820021246.2681624-1-yebin@huaweicloud.com>
From: Ye Bin <yebin10@huawei.com>
Allow the default value of prio_aging_expire to be overridden at load
time, in milliseconds to match the sysfs attribute:
- built-in: mq_deadline.prio_aging_expire=0 on the kernel command line
- module: modprobe mq_deadline prio_aging_expire=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.
Previously prio_aging_expire was a compile-time constant (10 * HZ)
with no way to change the default before the first request queue was
initialized. Make the variable a module_param so that the override
works whether mq-deadline is built-in or compiled as a module, and
convert the millisecond value to jiffies in dd_init_sched() when
assigning the per-queue default.
Signed-off-by: Ye Bin <yebin10@huawei.com>
---
block/mq-deadline.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index e3314f7aed8b..95a00a673be5 100644
--- a/block/mq-deadline.c
+++ b/block/mq-deadline.c
@@ -33,7 +33,10 @@ static const int write_expire = 5 * HZ; /* ditto for writes, these limits are SO
* Time after which to dispatch lower priority requests even if higher
* priority requests are pending.
*/
-static const int prio_aging_expire = 10 * HZ;
+static int prio_aging_expire = 10 * MSEC_PER_SEC;
+module_param(prio_aging_expire, int, 0644);
+MODULE_PARM_DESC(prio_aging_expire,
+ "Default prio_aging_expire in milliseconds; 0 disables I/O priority.");
static const int writes_starved = 2; /* max times reads can starve a write */
static const int fifo_batch = 16; /* # of sequential requests treated as one
by the above parameters. For throughput. */
@@ -559,7 +562,7 @@ static int dd_init_sched(struct request_queue *q, struct elevator_queue *eq)
dd->front_merges = 1;
dd->last_dir = DD_WRITE;
dd->fifo_batch = fifo_batch;
- dd->prio_aging_expire = prio_aging_expire;
+ dd->prio_aging_expire = msecs_to_jiffies(prio_aging_expire);
spin_lock_init(&dd->lock);
/* We dispatch from request queue wide instead of hw queue */
--
2.34.1
next prev parent reply other threads:[~2026-08-20 2:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 2:12 [PATCH 0/2] disable I/O priority when prio_aging_expire is zero Ye Bin
2026-08-20 2:12 ` [PATCH 1/2] block/mq-deadline: " Ye Bin
2026-08-20 15:31 ` Bart Van Assche
2026-08-21 2:06 ` yebin
2026-08-20 2:12 ` Ye Bin [this message]
2026-08-20 15:54 ` [PATCH 2/2] block/mq-deadline: add module parameter for prio_aging_expire default Bart Van Assche
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=20260820021246.2681624-3-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.