From: Uday Shankar <ushankar@purestorage.com>
To: linux-nvme@lists.infradead.org
Cc: Christoph Hellwig <hch@lst.de>, Keith Busch <kbusch@kernel.org>,
Sagi Grimberg <sagi@grimberg.me>, Jens Axboe <axboe@fb.com>
Subject: Re: [PATCH] nvme: scan sequentially only when list scan unsupported
Date: Fri, 4 Nov 2022 16:46:21 -0600 [thread overview]
Message-ID: <20221104224621.GA1437924@dev-ushankar.dev.purestorage.com> (raw)
In-Reply-To: <20221104223621.1435666-1-ushankar@purestorage.com>
> Currently, if nvme_scan_ns_list fails, nvme_scan_work will fall back to
> a sequential scan. nvme_scan_ns_list can fail for a variety of reasons,
> e.g. transient transport issue. And the resulting sequential scan can be
> extremely expensive on controllers reporting an NN value close to the
> maximum allowed (>4 billion). Avoid sequential scans wherever possible
> by only falling back to them if nvme_scan_ns_list fails due to
> controller non-support of Identify NS List.
Signed-off-by: Uday Shankar <ushankar@purestorage.com>
> ---
> This would break devices that claim to support version NVME_VS(1, 1, 0)
> or above, but don't support Identify NS List. But it looks like we
> already have NVME_QUIRK_IDENTIFY_CNS to deal with that.
>
> drivers/nvme/host/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 0090dc0b3ae6..5bd19819d33b 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -4535,7 +4535,7 @@ static void nvme_scan_work(struct work_struct *work)
> }
>
> mutex_lock(&ctrl->scan_lock);
> - if (nvme_scan_ns_list(ctrl) != 0)
> + if (nvme_scan_ns_list(ctrl) == -EOPNOTSUPP)
> nvme_scan_ns_sequential(ctrl);
> mutex_unlock(&ctrl->scan_lock);
> }
>
> base-commit: d30a909f9bb5283e701a5fdfffac763ef57a3e7c
> --
> 2.25.1
>
next prev parent reply other threads:[~2022-11-04 22:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 22:36 [PATCH] nvme: scan sequentially only when list scan unsupported Uday Shankar
2022-11-04 22:46 ` Uday Shankar [this message]
2022-11-07 5:56 ` Christoph Hellwig
2022-11-07 19:29 ` Uday Shankar
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=20221104224621.GA1437924@dev-ushankar.dev.purestorage.com \
--to=ushankar@purestorage.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 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.