[PATCH] nvme: document the per-subsystem iopolicy sysfs attributes

Guixin Liu kanie at linux.alibaba.com
Mon Nov 16 03:42:08 PST 2026


nvme-multipath.rst only mentions the global nvme_core.iopolicy module
parameter. That value is only picked up when a subsystem is created;
changing it does not affect subsystems that already exist. The runtime
interface is the per-subsystem iopolicy attribute, which applies the
new policy to a single subsystem immediately, plus the read-only
iopolicies attribute listing the supported policies. Document both,
and note that discovery subsystems report "none" and reject writes.

Signed-off-by: Guixin Liu <kanie at linux.alibaba.com>
---
 Documentation/admin-guide/nvme-multipath.rst | 35 +++++++++++++++++---
 1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/Documentation/admin-guide/nvme-multipath.rst b/Documentation/admin-guide/nvme-multipath.rst
index 97ca1ccef459b..058894187cbb8 100644
--- a/Documentation/admin-guide/nvme-multipath.rst
+++ b/Documentation/admin-guide/nvme-multipath.rst
@@ -24,12 +24,37 @@ Policies
 
 All policies follow the ANA (Asymmetric Namespace Access) mechanism, meaning
 that when an optimized path is available, it will be chosen over a non-optimized
-one. Current the NVMe multipath policies include numa(default), round-robin and
-queue-depth.
+one. The NVMe multipath policies currently include numa(default),
+round-robin and queue-depth.
 
-To set the desired policy (e.g., round-robin), use one of the following methods:
-   1. echo -n "round-robin" > /sys/module/nvme_core/parameters/iopolicy
-   2. or add the "nvme_core.iopolicy=round-robin" to cmdline.
+To set the desired policy, use one of the following methods:
+
+  1. Set the global default policy (e.g., round-robin), which is applied to
+     every subsystem when it is created, using either the sysfs module
+     parameter::
+
+	echo -n "round-robin" > /sys/module/nvme_core/parameters/iopolicy
+
+     or the kernel command line parameter "nvme_core.iopolicy=round-robin".
+     Subsystems that already exist keep their current policy.
+
+  2. Change the policy of a single subsystem at runtime::
+
+	echo -n "queue-depth" > /sys/class/nvme-subsystem/nvme-subsys0/iopolicy
+
+     The per-subsystem "iopolicy" attribute shows the policy currently in
+     effect. Writing a supported policy name to it takes effect immediately
+     for that subsystem only: the currently selected path of each namespace
+     is dropped, so that subsequent I/O is dispatched according to the new
+     policy, and the change is reported in the kernel log.
+
+The list of policies supported by the kernel can be read from the read-only
+"iopolicies" attribute::
+
+	cat /sys/class/nvme-subsystem/nvme-subsys0/iopolicies
+
+Discovery subsystems have no I/O paths and report "none" for both attributes;
+writing to their "iopolicy" attribute is not supported.
 
 
 NUMA
-- 
2.43.7




More information about the Linux-nvme mailing list