Skip to content

drain_workqueue vs scsi_flush_work

Dan Williams linux-scsi lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3workqueue: promote workqueue_lock to hard-irq safekernel/workqueue.c+22 -220 replies
2/3workqueue: defer work to a draining queueinclude/linux/workqueue.h kernel/workqueue.c+62 -112 replies
3/3scsi: use drain_workqueuedrivers/scsi/hosts.c drivers/scsi/isci/host.c include/scsi/scsi_host.h+5 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] drain_workqueue vs scsi_flush_work

Hi Tejun, James,

While trying to use drain_workqueue() in libsas I hit the WARN_ON_ONCE(!is_chained_work(wq)) in __queue_work(). However, as I mention in patch-2 libsas expects that new unchained work can be submitted during a drain. So, patch-2 is a hack to accept new work when drain_workqueue() is used publicly as a "stronger flush", while keeping the same warn+drop behavior for internal usages of drain_workqueue() in the destroy_workqueue() case.

Smoke tested on sas topoloogy of:
host-->ata
host-->expander-->ata
host-->expander-->expander-->ata

--
Dan

---

Dan Williams (3):
workqueue: promote workqueue_lock to hard-irq safe
workqueue: defer work to a draining queue
scsi: use drain_workqueue

 drivers/scsi/hosts.c      |    8 ++-
 drivers/scsi/isci/host.c  |    3 -
 include/linux/workqueue.h |    3 +
 include/scsi/scsi_host.h  |    2 -
 kernel/workqueue.c        |  114 ++++++++++++++++++++++++++++++++-------------
 5 files changed, 89 insertions(+), 41 deletions(-)