linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Meneghini, John" <John.Meneghini@netapp.com>
To: Keith Busch <kbusch@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Sagi Grimberg <sagi@grimberg.me>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	Jen Axboe <axboe@kernel.dk>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"Knight, Frederick" <Frederick.Knight@netapp.com>
Cc: Hannes Reinecke <hare@suse.de>,
	"Meneghini, John" <John.Meneghini@netapp.com>
Subject: Re: [PATCH V2] nvme: Add support for ACRE Command Interrupted status
Date: Wed, 4 Dec 2019 14:48:00 +0000	[thread overview]
Message-ID: <8FAB1EDA-3B06-43A8-92BC-E0840593E144@netapp.com> (raw)
In-Reply-To: <04835a2e-1769-36c9-63b8-173f247c862b@suse.de>

    On 12/3/19 10:00 PM, Keith Busch wrote:
    >> If the controllers returns Command Interrupted too many times, and nvme_req(req)->retries
    >> runs down, this results in a device resource error returned to the block layer.  But I think we'll
    >> have this problem with any error.
    >
    > Why is the controller returning the same error so many times? Are we
    > not waiting the requested delay timed? If so, the controller told us
    > retrying should be successful.

Yes, this a problem on the controller... but I only did this to test the pathological case.
I think we can all agree that if the controller is going to continually return Command
Interrupted, the controller is broken.

    > It is possible we kick the requeue list early if one command error
    > has a valid CRD, but a subsequent retryable command does not. Is that
    > what's happening?

Yes, as Hannes said, in the current code: NVME_SC_CMD_INTERRUPTED is not
handled in nvme_error_status() so it's translated as:

        default:
                return BLK_STS_IOERR;
 
This works fine with a single controller,  but when REQ_NVME_MPATH
is set the code goes down the nvme_failover_req() path, which
doesn't handle NVME_SC_CMD_INTERRUPTED either, and we end up
with:

       default:
                /*
                 * Reset the controller for any non-ANA error as we don't know
                 * what caused the error.
                 */
                nvme_reset_ctrl(ns->ctrl);
                break;
         }
    
So, the first time a controller with REQ_NVME_MPATH enabled returns
NVME_SC_CMD_INTERRUPTED it gets a controller reset.
    
    > I'm just concerned because if we just skip counting the retry, a broken
    > device could have the driver retry the same command indefinitely, which
    > often leaves a task in an uninterruptible sleep state forever.

No, I'm not recommending that we skip retries.  My diff was not a part
of this patch.  I agree that it's not safe to skip retry counting.

    >>     diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
    >>     index 9696404a6182..24dc9ed1a11b 100644
    >>     --- a/drivers/nvme/host/core.c
    >>     +++ b/drivers/nvme/host/core.c
    >>     @@ -230,6 +230,8 @@ static blk_status_t nvme_error_status(u16 status)
    >>                     return BLK_STS_NEXUS;
    >>             case NVME_SC_HOST_PATH_ERROR:
    >>                     return BLK_STS_TRANSPORT;
    >>     +       case NVME_SC_CMD_INTERRUPTED:
    >>     +               return BLK_STS_DEV_RESOURCE;
    >
    > Just for the sake of keeping this change isloted to nvme, perhaps use an
    > existing blk_status_t value that already maps to not path error, like
    > BLK_STS_TARGET.

I can make that change... but I think BLK_STS_DEV_RESOURCE might
be, semantically, a better choice.

[BLK_STS_TARGET]        = { -EREMOTEIO, "critical target" },
[BLK_STS_DEV_RESOURCE]  = { -EBUSY,     "device resource" },

The one use case we have for NVME_SC_CMD_INTERRUPTED in the Linux NVMe-oF target
is a resource allocation failure (e.g. ENOMEM).  I think Hannes came across this once 
while he was prototyping the ANA code in the Linux NVMe-oF target.

Another potential use case in the controller might be deadlock avoidance.

I was experimenting with NVME_SC_CMD_INTERRUPTED in my controller as a 
QOS mechanism.... but I don't think NVME_SC_CMD_INTERRUPTED /CRD is well suited
for that use case.  This that's how I created the pathological error case in my test.

Either way, I don't think that running out of retries when NVME_SC_CMD_INTERRUPTED
Is returned a critical target error. Moreover, it appears BLK_STS_TARGET is, everywhere,
related to some kind of LBA range error.

/John


      parent reply	other threads:[~2019-12-04 14:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27 19:12 [PATCH V2] nvme: Add support for ACRE Command Interrupted status Meneghini, John
2019-12-03 17:38 ` Meneghini, John
2019-12-03 21:00   ` Keith Busch
     [not found]     ` <04835a2e-1769-36c9-63b8-173f247c862b@suse.de>
2019-12-04 14:48       ` Meneghini, John [this message]

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=8FAB1EDA-3B06-43A8-92BC-E0840593E144@netapp.com \
    --to=john.meneghini@netapp.com \
    --cc=Frederick.Knight@netapp.com \
    --cc=axboe@kernel.dk \
    --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 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).