From: John Meneghini <jmeneghi@redhat.com>
To: Keith Busch <kbusch@meta.com>,
hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org
Cc: nilay@linux.ibm.com, Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH] nvme-multipath: fix io accounting on failover
Date: Tue, 21 May 2024 14:35:44 -0400 [thread overview]
Message-ID: <7fd93488-2c3c-472a-8560-7359b07c3870@redhat.com> (raw)
In-Reply-To: <20240521180712.2423165-1-kbusch@meta.com>
Awesome. I've noticed that there is an iostat bug lurking someplace during my many days of io policy testing these last two
weeks. I'll add this patch to my test build and let you know if it fixes the problem!
/John
On 5/21/24 14:07, Keith Busch wrote:> From: Keith Busch <kbusch@kernel.org>
>
> There are io stats accounting that needs to be handled, so don't call
> blk_mq_end_request() directly. Use the existing nvme_end_req() helper
> that already handles everything.
>
> Fixes: d4d957b53d91ee ("nvme-multipath: support io stats on the mpath device")
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> drivers/nvme/host/core.c | 2 +-
> drivers/nvme/host/multipath.c | 3 ++-
> drivers/nvme/host/nvme.h | 1 +
> 3 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 79cdd34dfa18e..7706df2373494 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -422,7 +422,7 @@ static inline void __nvme_end_req(struct request *req)
> nvme_mpath_end_request(req);
> }
>
> -static inline void nvme_end_req(struct request *req)
> +void nvme_end_req(struct request *req)
> {
> blk_status_t status = nvme_error_status(nvme_req(req)->status);
>
> diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
> index 9c1e135b8df3b..1bee176fd850e 100644
> --- a/drivers/nvme/host/multipath.c
> +++ b/drivers/nvme/host/multipath.c
> @@ -118,7 +118,8 @@ void nvme_failover_req(struct request *req)
> blk_steal_bios(&ns->head->requeue_list, req);
> spin_unlock_irqrestore(&ns->head->requeue_lock, flags);
>
> - blk_mq_end_request(req, 0);
> + nvme_req(req)->status = 0;
> + nvme_end_req(req);
> kblockd_schedule_work(&ns->head->requeue_work);
> }
>
> diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
> index cacc56f4bbf44..fc31bd340a63a 100644
> --- a/drivers/nvme/host/nvme.h
> +++ b/drivers/nvme/host/nvme.h
> @@ -767,6 +767,7 @@ static inline bool nvme_state_terminal(struct nvme_ctrl *ctrl)
> }
> }
>
> +void nvme_end_req(struct request *req);
> void nvme_complete_rq(struct request *req);
> void nvme_complete_batch_req(struct request *req);
>
next prev parent reply other threads:[~2024-05-21 18:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 18:07 [PATCH] nvme-multipath: fix io accounting on failover Keith Busch
2024-05-21 18:35 ` John Meneghini [this message]
2024-05-21 18:55 ` Keith Busch
2024-05-21 19:37 ` Christoph Hellwig
2024-05-21 20:10 ` Sagi Grimberg
2024-05-22 13:02 ` Nilay Shroff
2024-05-22 14:18 ` Keith Busch
2024-05-23 7:00 ` Nilay Shroff
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=7fd93488-2c3c-472a-8560-7359b07c3870@redhat.com \
--to=jmeneghi@redhat.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
--cc=linux-nvme@lists.infradead.org \
--cc=nilay@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox