Skip to content

fix / cleanup async scsi scanning

Dan Williams linux-scsi lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 9 repliesIn review
  2. v14 patches 8 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4async: introduce 'async_domain' typedrivers/regulator/core.c drivers/scsi/libsas/sas_ata.c drivers/scsi/scsi.c +3 more+54 -260 replies
2/4async: make async_synchronize_full() flush all work regardless of domaindrivers/scsi/scsi.c include/linux/async.h kernel/async.c+43 -20 replies
3/4scsi: queue async scan work to an async_schedule domaindrivers/scsi/scsi_scan.c+6 -60 replies
4/4scsi: cleanup usages of scsi_complete_async_scansdrivers/scsi/scsi_scan.c drivers/scsi/scsi_wait_scan.c include/scsi/scsi_scan.h +2 more+5 -434 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchMark BrownBorislav Petkov
SeriesT-b
1/4A-b
2/4
3/4
4/4

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

Read the v2 thread

Cover letter [PATCH v2 0/4] fix / cleanup async scsi scanning

Commit a7a20d10 "[SCSI] sd: limit the scope of the async probe domain" introduces a boot regression by moving sd probe work off of the global async queue. Using a local async domain hides the probe work from being synchronized by wait_for_device_probe()->async_synchronize_full().

Fix this by teaching async_synchronize_full() to flush all async work regardless of domain, and take the opportunity to convert scsi scanning to async_schedule(). This enables wait_for_device_probe() to flush scsi scanning work.

Changes since v1: http://marc.info/?l=linux-scsi&m=133793153025832&w=2

1/ Tested to fix the boot hang that Meelis reported with v1. Reworked
async_synchronize_full() to walk through all the active domains, otherwise we spin on !list_empty(async_domains) and prevent the async context from running.

2/ Added the ability for domains to opt-out of global syncing as
requested by Arjan, but also needed for domains that don't want to worry about list corruption when the domain goes out of scope (stack-allocated domains).

---

Dan Williams (4):
async: introduce 'async_domain' type
async: make async_synchronize_full() flush all work regardless of domain
scsi: queue async scan work to an async_schedule domain
scsi: cleanup usages of scsi_complete_async_scans

 drivers/regulator/core.c      |    2 +
 drivers/scsi/libsas/sas_ata.c |    2 +
 drivers/scsi/scsi.c           |    4 ++
 drivers/scsi/scsi_priv.h      |    3 +-
 drivers/scsi/scsi_scan.c      |   24 +++----------
 drivers/scsi/scsi_wait_scan.c |   15 +++-----
 include/linux/async.h         |   36 +++++++++++++++++--
 include/scsi/scsi_scan.h      |   11 ------
 kernel/async.c                |   76 +++++++++++++++++++++++++++++++----------
 kernel/power/hibernate.c      |    8 ----
 kernel/power/user.c           |    2 -
 11 files changed, 107 insertions(+), 76 deletions(-)
 delete mode 100644 include/scsi/scsi_scan.h