A New Attempt At Async Device Shutdown Support For Linux

Written by Michael Larabel in Hardware on 8 February 2024 at 06:49 AM EST. 2 Comments
HARDWARE
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:
"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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week