A New Attempt At Async Device Shutdown Support For Linux
Asynchronous device shutdown support for the Linux kernel has been pursued in the past as with hyperscalers like Google having too many NVMe storage devices can slow the shutdown/reboot process. Red Hat on Wednesday submitted a new patch series aiming to implement async device shutdown support.
Rather than synchronously shutting down devices/drivers that can at times be slow, the new Red Hat patches from David Jeffery aim to allow for async device shutdown. Besides adding the infrastructure to the kernel, the async shutdown is then wired up for PCI NVMe drives as well as SD devices. David Jeffery explained in the request for comments patch series:
The RFC patches are just about 400 lines of new code in current form. We'll see if this time the async device shutdown support is in good enough shape to make it to the mainline kernel.
Rather than synchronously shutting down devices/drivers that can at times be slow, the new Red Hat patches from David Jeffery aim to allow for async device shutdown. Besides adding the infrastructure to the kernel, the async shutdown is then wired up for PCI NVMe drives as well as SD devices. David Jeffery explained in the request for comments patch series:
"This is another attempt to implement an acceptable implementation of async device shutdown, inspired by a previous attempt by Tanjore Suresh. For systems with many disks, async shutdown can greatly reduce shutdown times from having slow operations run in parallel. The older patches were rejected, with this new implementation attempting to fix my understanding of the flaws in the older patches.
Using similar interfaces and building off the ideas of the older patches, this patchset creates an async shutdown implementation which follows the basic ordering of the shutdown list, ensuring the shutdown of any children devices complete whether synchronous or asynchronous before performing shutdown on a parent device.
In addition to an implementation for asynchronous pci nvme shutdown, this patchset also adds support for async shutdown of sd devices for cache flush. As an example of the effects of the patch, one system with a large amount of disks went from over 30 seconds to shut down to less than 5.
The specific driver changes are the roughest part of this patchset. But the acceptability of the core async functionality is critical. Any feedback on flaws or improvements is appreciated."
The RFC patches are just about 400 lines of new code in current form. We'll see if this time the async device shutdown support is in good enough shape to make it to the mainline kernel.
2 Comments