From: David Jeffery <[email protected]>
> 
> This patchset allows the kernel to shutdown devices asynchronously and
> unrelated async devices to be shut down in parallel to each other.
> 
> Only devices which explicitly enable it are shut down asynchronously. The
> default is for a device to be shut down from the synchronous shutdown loop.
> 
> This can dramatically reduce system shutdown/reboot time on systems that
> have multiple devices that take many seconds to shut down (like certain
> NVMe drives). On one system tested, the shutdown time went from 11 minutes
> without this patch to 55 seconds with the patch. And on another system from
> 80 seconds to 11.
> 

(Copying the linux-hyperv mailing list as FYI.)

Tested this patch set on two different x86/x64 VMs in the Azure public cloud.
Baseline kernel is linux-next20260312. The VMs are running on Hyper-V with
synthetic SCSI devices, PCI pass-thru NVME disks, and emulated PCI NVMe
disks, depending on the VM configuration.

First VM is an Azure L64s_v3, with 2 synthetic SCSI disks and 8 PCI NVMe
pass-thru disks. Time spent in device_shutdown() was reduced from
683 milliseconds to 150 milliseconds (averaged across 4 runs each).

Second VM is an Azure D32lds_v6, with 2 emulated NVMe disks and
4 NVMe pass-thru disks. Time sent in device_shutdown() was reduced from
1010 milliseconds to 610 milliseconds (averaged across 2 runs each).

In both cases, the results seem reasonable. None of these disks should
be particularly slow in shutting down, so the results are not as dramatic
are reported by David. But there is non-trivial improvement nonetheless.

Tested-by: Michael Kelley <[email protected]>

> 
> Stuart Hayes (2):
>   driver core: separate function to shutdown one device
>   driver core: don't always lock parent in shutdown
> 
> David Jeffery (5):
>   driver core: async device shutdown infrastructure
>   PCI: enable async shutdown support
>   scsi: enable async shutdown support
> 
>  drivers/base/base.h       |   2 +
>  drivers/base/core.c       | 176 +++++++++++++++++++++++++++++++-------
>  drivers/pci/probe.c       |   2 +
>  drivers/scsi/hosts.c      |   3 +
>  drivers/scsi/scsi_scan.c  |   1 +
>  drivers/scsi/scsi_sysfs.c |   4 +
>  include/linux/device.h    |  13 +++
>  7 files changed, 170 insertions(+), 31 deletions(-)
> 
> --
> 2.53.0
> 

Reply via email to