Skip to content

Commit 2a9426b

Browse files
author
CKI KWF Bot
committed
Merge: nvme-multipath: Skip nr_active increments in RETRY disposition
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7512 nvme-multipath: Skip nr_active increments in RETRY disposition JIRA: https://issues.redhat.com/browse/RHEL-111104 Upstream Status: From upstream linux mainline 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: Ewan D. Milne <emilne@redhat.com> Approved-by: John Meneghini <jmeneghi@redhat.com> Approved-by: Chris Leech <cleech@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 286279d + 65a16eb commit 2a9426b

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
@@ -137,12 +137,14 @@ void nvme_mpath_start_request(struct request *rq)
137137
struct nvme_ns *ns = rq->q->queuedata;
138138
struct gendisk *disk = ns->head->disk;
139139

140-
if (READ_ONCE(ns->head->subsys->iopolicy) == NVME_IOPOLICY_QD) {
140+
if ((READ_ONCE(ns->head->subsys->iopolicy) == NVME_IOPOLICY_QD) &&
141+
!(nvme_req(rq)->flags & NVME_MPATH_CNT_ACTIVE)) {
141142
atomic_inc(&ns->ctrl->nr_active);
142143
nvme_req(rq)->flags |= NVME_MPATH_CNT_ACTIVE;
143144
}
144145

145-
if (!blk_queue_io_stat(disk->queue) || blk_rq_is_passthrough(rq))
146+
if (!blk_queue_io_stat(disk->queue) || blk_rq_is_passthrough(rq) ||
147+
(nvme_req(rq)->flags & NVME_MPATH_IO_STATS))
146148
return;
147149

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

0 commit comments

Comments
 (0)