From: Daniel Wagner <dwagner@suse.de>
To: Qiliang Yuan <odys.yuan@gmail.com>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-block@vger.kernel.org, Hannes Reinecke <hare@kernel.org>,
Ming Lei <tom.leiming@gmail.com>,
Nilay Shroff <nilay@linux.ibm.com>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
Stuart Hayes <stuart.w.hayes@gmail.com>
Subject: Re: [PATCH v2] nvme: remove namespaces in parallel
Date: Tue, 3 Nov 2026 17:19:42 +0100 [thread overview]
Message-ID: <b6aab18c-f812-4164-a41d-e1b95e462709@flourine.local> (raw)
In-Reply-To: <20261103-bug-nvme-remove-ns-async-v2-1-44e43766e44a@gmail.com>
On Tue, Nov 03, 2026 at 01:28:02AM -0500, Qiliang Yuan wrote:
> +static void nvme_ns_remove_async(void *data, async_cookie_t cookie)
> +{
> + nvme_ns_remove(data);
> +}
> +
> /*
> * This function iterates the namespace list unlocked to allow recovery from
> * controller failure. It is up to the caller to ensure the namespace list is
> @@ -4725,6 +4730,7 @@ void nvme_remove_namespaces(struct nvme_ctrl *ctrl)
> {
> struct nvme_ns *ns, *next;
> LIST_HEAD(ns_list);
> + ASYNC_DOMAIN(domain);
>
> /*
> * make sure to requeue I/O to all namespaces as these
> @@ -4759,8 +4765,13 @@ void nvme_remove_namespaces(struct nvme_ctrl *ctrl)
> mutex_unlock(&ctrl->namespaces_lock);
> synchronize_srcu(&ctrl->srcu);
>
> + /*
> + * Remove the namespaces in parallel, as each removal waits for several
> + * RCU grace periods.
> + */
> list_for_each_entry_safe(ns, next, &ns_list, list)
> - nvme_ns_remove(ns);
> + async_schedule_domain(nvme_ns_remove_async, ns, &domain);
> + async_synchronize_full_domain(&domain);
Nice!
Reviewed-by: Daniel Wagner <dwagner@suse.de>
prev parent reply other threads:[~2026-11-03 16:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 6:28 Qiliang Yuan
2026-11-03 7:41 ` Nilay Shroff
2026-11-03 8:11 ` Christoph Hellwig
2026-11-03 13:14 ` Hannes Reinecke
2026-11-03 16:19 ` Daniel Wagner [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=b6aab18c-f812-4164-a41d-e1b95e462709@flourine.local \
--to=dwagner@suse.de \
--cc=axboe@kernel.dk \
--cc=hare@kernel.org \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=nilay@linux.ibm.com \
--cc=odys.yuan@gmail.com \
--cc=sagi@grimberg.me \
--cc=shinichiro.kawasaki@wdc.com \
--cc=stuart.w.hayes@gmail.com \
--cc=tom.leiming@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
all inboxes | Powered by JetHome®