[PATCH 2/2] docs: nvme-multipath: document service-time I/O policy
Guixin Liu
kanie at linux.alibaba.com
Wed Jun 17 04:45:59 PDT 2026
Add documentation for the service-time path selection policy, including
its algorithm overview, sysfs attributes (in_flight_bytes and
relative_throughput), and guidance on when to use it over queue-depth.
Document that setting relative_throughput to 0 makes the path a standby
that is only used when no path with a positive value is available.
Signed-off-by: Guixin Liu <kanie at linux.alibaba.com>
---
Documentation/admin-guide/nvme-multipath.rst | 31 ++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/Documentation/admin-guide/nvme-multipath.rst b/Documentation/admin-guide/nvme-multipath.rst
index 97ca1ccef459..2acfceaf3d65 100644
--- a/Documentation/admin-guide/nvme-multipath.rst
+++ b/Documentation/admin-guide/nvme-multipath.rst
@@ -24,8 +24,8 @@ 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. Current the NVMe multipath policies include numa(default), round-robin,
+queue-depth and service-time.
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
@@ -70,3 +70,30 @@ When to use the queue-depth policy:
1. High load with small I/Os: Effectively balances load across paths when
the load is high, and I/O operations consist of small, relatively
fixed-sized requests.
+
+
+Service-Time
+------------
+
+The service-time policy selects the path with the lowest estimated service time.
+It calculates service time as ``in_flight_bytes / relative_throughput`` for each
+path, preferring the path that would complete I/O fastest. Unlike queue-depth
+which counts requests regardless of size, service-time tracks actual bytes in
+flight, making it aware of I/O sizes.
+
+Each path exposes two sysfs attributes under
+``/sys/class/nvme/nvmeX/nvmeXcYnZ/``:
+
+ - ``in_flight_bytes`` (read-only): Current bytes in flight on this path.
+ - ``relative_throughput`` (read-write): Relative throughput weight for this
+ path, default 1. The valid range is 0-100. Set higher values for faster
+ paths. If set to 0, the path is not selected while other paths with
+ positive values are available.
+
+When to use the service-time policy:
+ 1. Asymmetric Link Speeds: When paths have different bandwidths, set
+ ``relative_throughput`` proportionally (e.g., 2 for a link twice as fast)
+ to steer more traffic to faster paths.
+ 2. Mixed I/O Sizes: When workloads mix small and large I/Os (e.g., 4K and
+ 128K), service-time distributes load more accurately than queue-depth
+ because it accounts for actual bytes rather than request count.
--
2.43.7
More information about the Linux-nvme
mailing list