linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: "Engel, Amit" <Amit.Engel@Dell.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: nvme host complete request tracing
Date: Thu, 18 May 2023 12:18:09 +0300	[thread overview]
Message-ID: <9c867339-2c79-ab45-4ff8-cfdfe4af2abc@grimberg.me> (raw)
In-Reply-To: <CO1PR19MB488584F51B17C06C58E8E84FEE7E9@CO1PR19MB4885.namprd19.prod.outlook.com>


> Hello,
> 
> nvme/host/core.c trace_nvme_complete_rq() is being called immediately when entering nvme_complete_rq()
> As I understand it, the idea behind this trace is to trace every single nvme request that is being completed.
> but this is actually not accurate since there are several options for a request as part of this function:
> COMPLETE, RETRY, FAILOVER

Well, it is completing this particular request.

> In order to better understand the status per nvme request I think it’s better to have a separate trace per each case, something like:
> trace_nvme_end_rq(req), trace_nvme_retry_rq(req), trace_nvme_failover_rq(req) etc.

Maybe we can add the disposition to the trace?

Something like:
--
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index b374e6007553..eaf03ff61224 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -393,14 +393,17 @@ static inline void nvme_end_req(struct request *req)
  void nvme_complete_rq(struct request *req)
  {
         struct nvme_ctrl *ctrl = nvme_req(req)->ctrl;
+       enum nvme_disposition disposition;

-       trace_nvme_complete_rq(req);
         nvme_cleanup_cmd(req);

         if (ctrl->kas)
                 ctrl->comp_seen = true;

-       switch (nvme_decide_disposition(req)) {
+       disposition = nvme_decide_disposition(req);
+       trace_nvme_complete_rq(req, disposition);
+
+       switch (disposition) {
         case COMPLETE:
                 nvme_end_req(req);
                 return;
--


  reply	other threads:[~2023-05-18  9:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17 16:27 nvme host complete request tracing Engel, Amit
2023-05-18  9:18 ` Sagi Grimberg [this message]
2023-05-19  8:59   ` Chaitanya Kulkarni
2023-05-19  9:18     ` Engel, Amit
2023-05-22  5:52       ` Chaitanya Kulkarni
2023-05-22  6:28         ` Sagi Grimberg

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=9c867339-2c79-ab45-4ff8-cfdfe4af2abc@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=Amit.Engel@Dell.com \
    --cc=linux-nvme@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).