linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chao Leng <lengchao@huawei.com>
To: Sagi Grimberg <sagi@grimberg.me>, <linux-nvme@lists.infradead.org>
Cc: kbusch@kernel.org, axboe@fb.com, hch@lst.de
Subject: Re: [PATCH] nvme-core: optimize process for error status NVME_SC_CMD_INTERRUPTED
Date: Sat, 25 Jul 2020 17:00:44 +0800	[thread overview]
Message-ID: <b672ba3f-9d1f-74f8-e927-0b6081b266d4@huawei.com> (raw)
In-Reply-To: <29618961-2596-7d75-40de-13af435d2d83@grimberg.me>


On 2020/7/25 6:01, Sagi Grimberg wrote:
>
>> @@ -243,7 +242,7 @@ static blk_status_t nvme_error_status(u16 status)
>>     static inline bool nvme_req_needs_retry(struct request *req)
>>   {
>> -    if (blk_noretry_request(req))
>> +    if (!nvme_req_local_retry(req) && blk_noretry_request(req))
>
> Why is this needed?

Because if work with dm-multipath or other multipath software,
the multipath software will set cmd_flags as REQ_FAILFAST_TRANSPORT.
If io return with any error, nvme will return io error to block layer,
the multipath will set the path fault and retry in other path,
but realy need retry in the current path in some scenarios.
So we need introduce nvme_req_local_retry to check if need retry
in the current path, if needed, do not need checking the cmd_flags
through blk_noretry_request. According the protocol define,
the error code NVME_SC_CMD_INTERRUPTED is a good choice.

The scenario which need retry in the current path:
Scenario 1: user configures a QoS policy on the storage system.
Storage system need to tell host to retry io after a defined time
when need control QoS. Host should retry the io in the current path
instead of return io to block layer.

Scenario 3:many hosts(more than 100) access the same storage device.
I/Os are not delivered at the same time in most cases,however a large
number of I/Os may be burst delivered at the same time sometimes.
In this case, the storage device can not treat all I/Os, needs host
retry in the current path after a defined time.

Scenario 3: storage software upgrade inline. The storage system may need
host retry in the current path after software upgrade completed.


>
>>           return false;
>>       if (nvme_req(req)->status & NVME_SC_DNR)
>>           return false;
>> diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
>> index 1de3f9b827aa..3213aae8985c 100644
>> --- a/drivers/nvme/host/nvme.h
>> +++ b/drivers/nvme/host/nvme.h
>> @@ -725,4 +725,10 @@ void nvme_hwmon_init(struct nvme_ctrl *ctrl);
>>   static inline void nvme_hwmon_init(struct nvme_ctrl *ctrl) { }
>>   #endif
>>   +static inline bool nvme_req_local_retry(struct request *req)
>> +{
>> +    if (nvme_req(req)->status == NVME_SC_CMD_INTERRUPTED)
>> +        return true;
>> +    return false;
>> +}
>>   #endif /* _NVME_H */
>>

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

      reply	other threads:[~2020-07-25  9:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24  8:14 [PATCH] nvme-core: optimize process for error status NVME_SC_CMD_INTERRUPTED Chao Leng
2020-07-24 22:01 ` Sagi Grimberg
2020-07-25  9:00   ` Chao Leng [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=b672ba3f-9d1f-74f8-e927-0b6081b266d4@huawei.com \
    --to=lengchao@huawei.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=kbusch@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).