Skip to content

RFC async device shutdown support

David Jeffery linux-nvme linux-scsi lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6minimal async shutdown infrastructuredrivers/base/core.c include/linux/device/bus.h include/linux/device/driver.h+127 -42 replies
2/6Improve ability to perform async shutdown in paralleldrivers/base/base.h drivers/base/core.c+52 -200 replies
3/6pci bus async shutdown supportdrivers/pci/pci-driver.c include/linux/pci.h+26 -20 replies
4/6pci nvme async shutdown supportdrivers/nvme/host/core.c drivers/nvme/host/nvme.h drivers/nvme/host/pci.c+73 -80 replies
5/6scsi mid layer support for async command submitdrivers/scsi/scsi_lib.c include/scsi/scsi_device.h+118 -280 replies
6/6sd: async cache flush on shutdowndrivers/scsi/sd.c drivers/scsi/sd.h+62 -60 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by.

PatchLaurence Oberman
1/6T-b
2/6T-b
3/6T-b
4/6T-b
5/6T-b
6/6T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/6] async device shutdown support

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.

David Jeffery (6):
minimal async shutdown infrastructure Improve ability to perform async shutdown in parallel pci bus async shutdown support
pci nvme async shutdown support
scsi mid layer support for async command submit
sd: async cache flush on shutdown

 drivers/base/base.h           |   1 +
 drivers/base/core.c           | 149 +++++++++++++++++++++++++++++++++-
 drivers/nvme/host/core.c      |  26 ++++--
 drivers/nvme/host/nvme.h      |   2 +
 drivers/nvme/host/pci.c       |  53 +++++++++++-
 drivers/pci/pci-driver.c      |  24 +++++-
 drivers/scsi/scsi_lib.c       | 138 ++++++++++++++++++++++++-------
 drivers/scsi/sd.c             |  66 +++++++++++++--
 drivers/scsi/sd.h             |   2 +
 include/linux/device/bus.h    |   8 +-
 include/linux/device/driver.h |   7 ++
 include/linux/pci.h           |   4 +
 include/scsi/scsi_device.h    |   8 ++
 13 files changed, 439 insertions(+), 49 deletions(-)
Signature · 1 line
2.43.0