All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Amit Chaudhary <achaudhary@purestorage.com>
Cc: Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
	Sagi Grimberg <sagi@grimberg.me>,
	mkhalfella@purestorage.com, randyj@purestorage.com,
	jmeneghi@redhat.com, emilne@redhat.com,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] nvme-multipath: Skip nr_active increments in RETRY disposition
Date: Wed, 24 Sep 2025 17:02:51 -0600	[thread overview]
Message-ID: <aNR4m9wrO5cgFZIe@kbusch-mbp> (raw)
In-Reply-To: <20250924224319.4557-1-achaudhary@purestorage.com>

On Wed, Sep 24, 2025 at 03:43:18PM -0700, Amit Chaudhary wrote:
>  static inline void nvme_start_request(struct request *rq)
>  {
> -	if (rq->cmd_flags & REQ_NVME_MPATH)
> +	if ((rq->cmd_flags & REQ_NVME_MPATH) && (!nvme_req(rq)->retries))
>  		nvme_mpath_start_request(rq);
>  	blk_mq_start_request(rq);
>  }

Using "retries" is bit indirect as a proxy for multipath active counts.
Could this be moved to the mpath start instead, directly using the flag
that accounts for the path? This also helps to keep track if the command
gets retried across a user toggling the policy to "qd".

---
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 3da980dc60d91..1c630967ddd40 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -182,7 +182,8 @@ void nvme_mpath_start_request(struct request *rq)
        struct nvme_ns *ns = rq->q->queuedata;
        struct gendisk *disk = ns->head->disk;

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


  reply	other threads:[~2025-09-24 23:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24 22:43 [PATCH 1/1] nvme-multipath: Skip nr_active increments in RETRY disposition Amit Chaudhary
2025-09-24 23:02 ` Keith Busch [this message]
2025-09-25  1:14   ` Mohamed Khalfella
2025-09-25 14:43     ` Keith Busch
2025-09-25 15:59       ` Mohamed Khalfella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aNR4m9wrO5cgFZIe@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=achaudhary@purestorage.com \
    --cc=axboe@kernel.dk \
    --cc=emilne@redhat.com \
    --cc=hch@lst.de \
    --cc=jmeneghi@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=mkhalfella@purestorage.com \
    --cc=randyj@purestorage.com \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.