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 3/4] block/mq-deadline: add module parameter for prio_enable
Date: Mon, 31 Aug 2026 19:01:43 +0800	[thread overview]
Message-ID: <20260831110144.2648156-4-yebin@huaweicloud.com> (raw)
In-Reply-To: <20260831110144.2648156-1-yebin@huaweicloud.com>

From: 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>
---
 block/mq-deadline.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index 276ce249d326..b30924e0b297 100644
--- a/block/mq-deadline.c
+++ b/block/mq-deadline.c
@@ -37,6 +37,17 @@ static const int write_expire = 5 * HZ; /* ditto for writes, these limits are SO
  * inversion.
  */
 static const int prio_aging_expire = 10 * HZ;
+
+/*
+ * Whether to enable I/O priority support (RT/BE/IDLE distinction).
+ * When false 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.
+ */
+static bool prio_enable = true;
+module_param(prio_enable, bool, 0644);
+MODULE_PARM_DESC(prio_enable,
+		 "Enable I/O priority (RT/BE/IDLE); 0 = best-effort only.");
 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. */
@@ -561,7 +572,7 @@ static int dd_init_sched(struct request_queue *q, struct elevator_queue *eq)
 	dd->last_dir = DD_WRITE;
 	dd->fifo_batch = fifo_batch;
 	dd->prio_aging_expire = prio_aging_expire;
-	dd->prio_enable = true;
+	dd->prio_enable = prio_enable;
 	spin_lock_init(&dd->lock);
 
 	/* We dispatch from request queue wide instead of hw queue */
-- 
2.34.1


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

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