From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Keith Busch <kbusch@kernel.org>, Sagi Grimberg <sagi@grimberg.me>,
Stuart Hayes <stuart.w.hayes@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH v2] nvme_core: scan namespaces asynchronously
Date: Tue, 23 Jan 2024 20:21:39 +0000 [thread overview]
Message-ID: <c05add9f-d375-44a4-a859-2757b19c70dc@nvidia.com> (raw)
In-Reply-To: <Za_rVS-0MEr2U731@kbusch-mbp.dhcp.thefacebook.com>
On 1/23/2024 8:37 AM, Keith Busch wrote:
> On Mon, Jan 22, 2024 at 11:13:15AM +0200, Sagi Grimberg wrote:
>> On 1/18/24 23:03, Stuart Hayes wrote:
>>> @@ -3901,19 +3932,25 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl)
>>> goto free;
>>> }
>>> + /*
>>> + * scan list starting at list offset 0
>>> + */
>>> + atomic_set(&scan_state.count, 0);
>>> for (i = 0; i < nr_entries; i++) {
>>> u32 nsid = le32_to_cpu(ns_list[i]);
>>> if (!nsid) /* end of the list? */
>>> goto out;
>>> - nvme_scan_ns(ctrl, nsid);
>>> + async_schedule_domain(nvme_scan_ns, &scan_state, &domain);
>>> while (++prev < nsid)
>>> nvme_ns_remove_by_nsid(ctrl, prev);
>>> }
>>> + async_synchronize_full_domain(&domain);
>
> You mentioned async scanning was an improvement if you have 1000
> namespaces, but wouldn't this be worse if you have very few namespaces?
> IOW, the decision to use the async schedule should be based on
> nr_entries, right?
>
Perhaps it's also helpful to documents the data for small number of
namespaces, we can think of collecting data something like this:-
NR Namespaces Seq Scan Async Scan
2
4
8
16
32
64
128
256
512
1024
If we find that difference is not that much then we can go ahead with
this patch, if it the difference is not acceptable to the point that it
will regress for common setups then we can make it configurable ?
-ck
next prev parent reply other threads:[~2024-01-23 20:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-18 21:03 [PATCH v2] nvme_core: scan namespaces asynchronously Stuart Hayes
2024-01-22 9:13 ` Sagi Grimberg
2024-01-22 9:21 ` Sagi Grimberg
2024-01-23 16:37 ` Keith Busch
2024-01-23 20:21 ` Chaitanya Kulkarni [this message]
2024-01-24 19:32 ` stuart hayes
2024-01-24 19:38 ` stuart hayes
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=c05add9f-d375-44a4-a859-2757b19c70dc@nvidia.com \
--to=chaitanyak@nvidia.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
--cc=stuart.w.hayes@gmail.com \
/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