[PATCH v2 3/7] nvme-multipath: queue-depth support for marginal paths
From: Jesse Taube
Date: Wed Sep 02 2026 - 16:42:19 EST
From: John Meneghini <jmeneghi@xxxxxxxxxx>
Exclude marginal paths from queue-depth io policy. In the case where all
paths are marginal and no optimized or non-optimized path is found, we
fall back and select the best marginal path.
Signed-off-by: Jesse Taube <jtaubepe@xxxxxxxxxx>
Signed-off-by: John Meneghini <jmeneghi@xxxxxxxxxx>
---
V10 -> V1:
- New commit
V1 -> V2:
- Rewrite
---
drivers/nvme/host/multipath.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index dbf09cdda815..f28797deab68 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -439,12 +439,17 @@ static struct nvme_ns *nvme_queue_depth_path(struct nvme_ns_head *head)
struct nvme_ns *best_opt = NULL, *best_nonopt = NULL, *ns;
unsigned int min_depth_opt = UINT_MAX, min_depth_nonopt = UINT_MAX;
unsigned int depth;
+ bool need_marginal = nvme_all_paths_marginal(head);
list_for_each_entry_srcu(ns, &head->list, siblings,
srcu_read_lock_held(&head->srcu)) {
if (nvme_path_is_disabled(ns))
continue;
+ /* Skip marginal paths unless we need to use them */
+ if (!need_marginal && nvme_ctrl_is_marginal(ns->ctrl))
+ continue;
+
depth = atomic_read(&ns->ctrl->nr_active);
switch (ns->ana_state) {
--
2.55.0