Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: document the per-subsystem iopolicy sysfs attributes
@ 2026-11-16 11:42 Guixin Liu
  2026-11-25  6:38 ` Guixin Liu
  2026-11-25  7:11 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Guixin Liu @ 2026-11-16 11:42 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Nilay Shroff, Daniel Wagner, Hannes Reinecke
  Cc: linux-nvme

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@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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] nvme: document the per-subsystem iopolicy sysfs attributes
  2026-11-16 11:42 [PATCH] nvme: document the per-subsystem iopolicy sysfs attributes Guixin Liu
@ 2026-11-25  6:38 ` Guixin Liu
  2026-11-25  7:11 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Guixin Liu @ 2026-11-25  6:38 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Nilay Shroff, Daniel Wagner, Hannes Reinecke
  Cc: linux-nvme

Hi all,
  Gently ping, this patch may have gotten buried in the malling list traffic.

Best Regards,
Guixin Liu

在 2026/11/16 19:42, Guixin Liu 写道:
> 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@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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nvme: document the per-subsystem iopolicy sysfs attributes
  2026-11-16 11:42 [PATCH] nvme: document the per-subsystem iopolicy sysfs attributes Guixin Liu
  2026-11-25  6:38 ` Guixin Liu
@ 2026-11-25  7:11 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2026-11-25  7:11 UTC (permalink / raw)
  To: Guixin Liu
  Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Nilay Shroff, Daniel Wagner, Hannes Reinecke, linux-nvme

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-25  7:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 11:42 [PATCH] nvme: document the per-subsystem iopolicy sysfs attributes Guixin Liu
2026-11-25  6:38 ` Guixin Liu
2026-11-25  7:11 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox