Skip to content

nvme: remove namespaces in parallel - #17

Open
ghost wants to merge 1 commit into
for-next_basefrom
series/1199829=>for-next
Open

ghost wants to merge 1 commit into
for-next_basefrom
series/1199829=>for-next

Conversation

@ghost

@ghost ghost commented Nov 10, 2026

Copy link
Copy Markdown

Pull request for series with
subject: nvme: remove namespaces in parallel
version: 2
url: https://patchwork.kernel.org/series/1199829/

@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: de52810
series: https://patchwork.kernel.org/series/1199829/
version: 2

@ghost
ghost force-pushed the for-next_base branch from 8c33852 to 18eb5ad Compare November 10, 2026 10:19
@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: de52810
series: https://patchwork.kernel.org/series/1199829/
version: 2

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 4e893ca
("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@gmail.com>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
@ghost
ghost force-pushed the series/1199829=>for-next branch from 5f8bbbe to 0560afe Compare November 10, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants