[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6629583d-4681-49bc-8a7c-a87c3051c30b@gmail.com>
Date: Wed, 17 Jul 2024 21:10:23 -0500
From: stuart hayes <stuart.w.hayes@...il.com>
To: Keith Busch <kbusch@...nel.org>
Cc: linux-kernel@...r.kernel.org, Jens Axboe <axboe@...nel.dk>,
Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
linux-nvme@...ts.infradead.org, Hannes Reinecke <hare@...e.de>,
Martin Wilck <martin.wilck@...e.com>,
Ayush Siddarath <ayush.siddarath@...l.com>
Subject: Re: [PATCH v4] nvme_core: scan namespaces asynchronously
On 7/17/2024 3:46 PM, Keith Busch wrote:
> On Wed, Jul 17, 2024 at 01:55:50PM -0500, Stuart Hayes wrote:
>
> Looks good to me. Just one minor comment below.
>
>> @@ -3978,11 +4008,15 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl)
>> __le32 *ns_list;
>> u32 prev = 0;
>> int ret = 0, i;
>> + ASYNC_DOMAIN(domain);
>> + struct async_scan_info scan_info;
>>
>> ns_list = kzalloc(NVME_IDENTIFY_DATA_SIZE, GFP_KERNEL);
>> if (!ns_list)
>> return -ENOMEM;
>>
>> + scan_info.ctrl = ctrl;
>> + scan_info.ns_list = ns_list;
>> for (;;) {
>> struct nvme_command cmd = {
>> .identify.opcode = nvme_admin_identify,
>> @@ -3998,19 +4032,23 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl)
>> goto free;
>> }
>>
>> + atomic_set(&scan_info.next_nsid, 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_async, &scan_info,
>> + &domain);
>> while (++prev < nsid)
>> nvme_ns_remove_by_nsid(ctrl, prev);
>> }
>> + async_synchronize_full_domain(&domain);
>> }
>> out:
>> nvme_remove_invalid_namespaces(ctrl, prev);
>> free:
>> + async_synchronize_full_domain(&domain);
>
> A goto this "free" label appears to mean the async domain has nothing
> scheduled, so synchronizing won't be necessary. This should be moved up
> tharmlesso the "out" label, I think.
>
> I can change that up when applying; just wanted to mention it in case
> I'm missing something.
I agree, you aren't missing anything. Thank you very much! If you want
me to submit a new patch with this and Thomas' changes, let me know.
Powered by blists - more mailing lists