[PATCH v2] nvme: remove namespaces in parallel
Nilay Shroff
nilay at linux.ibm.com
Mon Nov 2 23:41:38 PST 2026
On 11/3/26 11:58 AM, Qiliang Yuan wrote:
> nvme_remove_namespaces() removes the namespaces of a controller one
> after another. Each removal waits for RCU grace periods in
> del_gendisk() for the namespace and for its multipath head, about
> 20 ms in all.
>
> Deleting a controller, such as disconnecting from a fabrics target,
> thus takes time proportional to its namespace count, over a second for
> 64 namespaces. Scanning had the same problem until commit 4e893ca81170
> ("nvme_core: scan namespaces asynchronously") made it add namespaces
> in parallel.
>
> Remove the namespaces through an async domain the same way, and wait
> for all of them before returning. Each removal still waits about
> 20 ms, but the waits now overlap: a grace period is system-wide, so
> removals that wait at the same time are released by the same grace
> periods instead of each needing its own.
>
> Disconnect time from a target on the same host, over tcp to 127.0.0.1
> and over nvme-loop, with 4 I/O queues, median of 3 runs on each of two
> boots per kernel:
>
> namespaces transport before after
> 8 tcp 170 / 171 ms 85 / 91 ms
> 32 tcp 628 / 628 ms 294 / 293 ms
> 64 tcp 1201 / 1308 ms 533 / 550 ms
> 64 loop 1988 / 1913 ms 1283 / 1200 ms
>
> Signed-off-by: Qiliang Yuan<odys.yuan at gmail.com>
Looks good to me:
Reviewed-by: Nilay Shroff <nilay at linux.ibm.com>
More information about the Linux-nvme
mailing list