Linux 7.4 optimizes NVMe namespace removal via parallel execution
The Linux kernel will now remove NVMe namespaces in parallel, significantly reducing controller disconnection times in high-density storage environments.
Summary
A new optimization for the NVMe subsystem has been merged into the Linux 7.4 kernel series, specifically targeting the namespace removal process. Previously, the kernel removed namespaces sequentially, which created a significant bottleneck when dealing with controllers managing a large number of logical volumes.
This change, implemented by software engineer Qiliang Yuan, allows the kernel to handle namespace deletions through an asynchronous domain. This is particularly beneficial for users in multi-tenant environments, high-performance storage deployments, and systems utilizing NVMe over Fabrics (NVMe-oF) where rapid controller disconnection is required.
Parallelizing NVMe namespace deletion
- Sequential Bottleneck: The previous
nvme_remove_namespaces()function removed namespaces one by one, with each removal waiting for RCU grace periods indel_gendisk()for both the namespace and its multipath head, totaling approximately 20 ms per namespace. - Asynchronous Implementation: The new logic utilizes an async domain to trigger removals in parallel, allowing the 20 ms waits to overlap rather than stacking linearly.
- Scalability Improvement: For a controller with 64 namespaces, the previous sequential method could take over a second to complete; the parallel approach leverages system-wide RCU grace periods to release multiple removals simultaneously.
- Consistency with Scanning: This optimization brings the removal process in line with previous improvements to the namespace scanning subsystem, which already supports asynchronous addition.
Why it matters
This update is critical for data center administrators and cloud providers using NVMe-based storage for workload isolation and multi-tenancy. By reducing the time required to tear down namespaces, the kernel improves the responsiveness of storage orchestration and fabric-based storage management.
Original reference: www.phoronix.com →