From: Jens Axboe <axboe@kernel.dk>
To: Sagi Grimberg <sagi@grimberg.me>, Hannes Reinecke <hare@suse.de>,
linux-nvme@lists.infradead.org
Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>,
Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
linux-block@vger.kernel.org
Subject: Re: [PATCH v2 2/2] nvme: support io stats on the mpath device
Date: Tue, 29 Nov 2022 07:33:15 -0700 [thread overview]
Message-ID: <ac488153-9a3c-1758-e596-e6c7928e984e@kernel.dk> (raw)
In-Reply-To: <0733f642-8b97-b6ce-8a0e-14c3bb8e2a9a@grimberg.me>
On 10/4/22 2:19 AM, Sagi Grimberg wrote:
>
>
> On 10/4/22 09:11, Hannes Reinecke wrote:
>> On 10/3/22 11:43, Sagi Grimberg wrote:
>>> Our mpath stack device is just a shim that selects a bottom namespace
>>> and submits the bio to it without any fancy splitting. This also means
>>> that we don't clone the bio or have any context to the bio beyond
>>> submission. However it really sucks that we don't see the mpath device
>>> io stats.
>>>
>>> Given that the mpath device can't do that without adding some context
>>> to it, we let the bottom device do it on its behalf (somewhat similar
>>> to the approach taken in nvme_trace_bio_complete).
>>>
>>> When the IO starts, we account the request for multipath IO stats using
>>> REQ_NVME_MPATH_IO_STATS nvme_request flag to avoid queue io stats disable
>>> in the middle of the request.
>>>
>>> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
>>> ---
>>> drivers/nvme/host/core.c | 4 ++++
>>> drivers/nvme/host/multipath.c | 25 +++++++++++++++++++++++++
>>> drivers/nvme/host/nvme.h | 12 ++++++++++++
>>> 3 files changed, 41 insertions(+)
>>>
>>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>>> index 64fd772de817..d5a54ddf73f2 100644
>>> --- a/drivers/nvme/host/core.c
>>> +++ b/drivers/nvme/host/core.c
>>> @@ -384,6 +384,8 @@ static inline void nvme_end_req(struct request *req)
>>> nvme_log_error(req);
>>> nvme_end_req_zoned(req);
>>> nvme_trace_bio_complete(req);
>>> + if (req->cmd_flags & REQ_NVME_MPATH)
>>> + nvme_mpath_end_request(req);
>>> blk_mq_end_request(req, status);
>>> }
>>> @@ -421,6 +423,8 @@ EXPORT_SYMBOL_GPL(nvme_complete_rq);
>>> void nvme_start_request(struct request *rq)
>>> {
>>> + if (rq->cmd_flags & REQ_NVME_MPATH)
>>> + nvme_mpath_start_request(rq);
>>> blk_mq_start_request(rq);
>>> }
>>> EXPORT_SYMBOL_GPL(nvme_start_request);
>>
>> Why don't you move the check for REQ_NVME_MPATH into nvme_mpath_{start,end}_request?
>
> I'm less fond of calling a function that may or may not
> do anything...
>
> But it is a pattern that exists in the code, if people prefer
> it I can change it.
I prefer it the way that you have it, avoids a function call for
the hot path of not being multipath.
--
Jens Axboe
next prev parent reply other threads:[~2022-11-29 14:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-03 9:43 [PATCH v2 0/2] nvme-mpath: Add IO stats support Sagi Grimberg
2022-10-03 9:43 ` [PATCH v2 1/2] nvme: introduce nvme_start_request Sagi Grimberg
2022-10-04 6:09 ` Hannes Reinecke
2022-11-29 14:28 ` Keith Busch
2022-11-29 14:32 ` Jens Axboe
2022-11-29 14:31 ` Jens Axboe
2022-10-03 9:43 ` [PATCH v2 2/2] nvme: support io stats on the mpath device Sagi Grimberg
2022-10-04 6:11 ` Hannes Reinecke
2022-10-04 8:19 ` Sagi Grimberg
2022-11-29 14:33 ` Jens Axboe [this message]
2022-11-29 14:33 ` Jens Axboe
2022-11-29 14:42 ` Keith Busch
2022-11-29 14:45 ` [PATCH v2 0/2] nvme-mpath: Add IO stats support Christoph Hellwig
2022-11-29 16:43 ` Keith Busch
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=ac488153-9a3c-1758-e596-e6c7928e984e@kernel.dk \
--to=axboe@kernel.dk \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--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.