Skip to content

Commit 3f58a29

Browse files
committed
nvme-multipath: Skip nr_active increments in RETRY disposition
jira KERNEL-238 Rebuild_History Non-Buildable kernel-6.12.0-124.16.1.el10_1 commit-author Amit Chaudhary <achaudhary@purestorage.com> commit bb642e2 For queue-depth I/O policy, this patch fixes unbalanced I/Os across nvme multipaths. Issue Description: The RETRY disposition incorrectly increments ns->ctrl->nr_active counter and reinitializes iostat start-time. In such cases nr_active counter never goes back to zero until that path disconnects and reconnects. Such a path is not chosen for new I/Os if multiple RETRY cases on a given a path cause its queue-depth counter to be artificially higher compared to other paths. This leads to unbalanced I/Os across paths. The patch skips incrementing nr_active if NVME_MPATH_CNT_ACTIVE is already set. And it skips restarting io stats if NVME_MPATH_IO_STATS is already set. base-commit: e989a3da2d371a4b6597ee8dee5c72e407b4db7a Fixes: d4d957b ("nvme-multipath: support io stats on the mpath device") Signed-off-by: Amit Chaudhary <achaudhary@purestorage.com> Reviewed-by: Randy Jennings <randyj@purestorage.com> Signed-off-by: Keith Busch <kbusch@kernel.org> (cherry picked from commit bb642e2) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 83c2a39 commit 3f58a29

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/nvme/host/multipath.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,14 @@ void nvme_mpath_start_request(struct request *rq)
126126
struct nvme_ns *ns = rq->q->queuedata;
127127
struct gendisk *disk = ns->head->disk;
128128

129-
if (READ_ONCE(ns->head->subsys->iopolicy) == NVME_IOPOLICY_QD) {
129+
if ((READ_ONCE(ns->head->subsys->iopolicy) == NVME_IOPOLICY_QD) &&
130+
!(nvme_req(rq)->flags & NVME_MPATH_CNT_ACTIVE)) {
130131
atomic_inc(&ns->ctrl->nr_active);
131132
nvme_req(rq)->flags |= NVME_MPATH_CNT_ACTIVE;
132133
}
133134

134-
if (!blk_queue_io_stat(disk->queue) || blk_rq_is_passthrough(rq))
135+
if (!blk_queue_io_stat(disk->queue) || blk_rq_is_passthrough(rq) ||
136+
(nvme_req(rq)->flags & NVME_MPATH_IO_STATS))
135137
return;
136138

137139
nvme_req(rq)->flags |= NVME_MPATH_IO_STATS;

0 commit comments

Comments
 (0)