scsi: eliminate AioContext lock
Status from this message: Thanks, applied to the block branch.
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 3 repliesApplied
- v14 patches 13 repliesSuperseded
Changes in v2 from the cover letter
- Reschedule BH in new AioContext if change is detected [Kevin]
- Drop stray "remember" in Patch 2's commit description [Eric]
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | scsi: only access SCSIDevice->requests from one threadhw/ include/ | +130 | 2 replies | |
| 2/4 | virtio-scsi: don't lock AioContext around virtio_queue_aio_attach_host_notifier()hw/ | +1 | 0 replies | |
| 3/4 | scsi: don't lock AioContext in I/O code pathhw/ hw/ | +3 | 0 replies | |
| 4/4 | dma-helpers: don't lock AioContext in dma_blk_cb()system/ | +2 | 0 replies |
Reviews trailers per patch
All 4 patches have a Reviewed-by or Acked-by.
| Patch | Eric Blake | Kevin Wolf |
|---|---|---|
| 1/4 | R-b | |
| 2/4 | R-b | R-b |
| 3/4 | R-b | A-b |
| 4/4 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/4] scsi: eliminate AioContext lock
v2:
- Reschedule BH in new AioContext if change is detected [Kevin]
- Drop stray "remember" in Patch 2's commit description [Eric]
The SCSI subsystem uses the AioContext lock to protect internal state. This is necessary because the main loop and the IOThread can access SCSI state in parallel. This inter-thread access happens during scsi_device_purge_requests() and scsi_dma_restart_cb().
This patch series modifies the code so SCSI state is only accessed from the IOThread that is executing requests. Once this has been achieved the AioContext lock is no longer necessary.
Note that a few aio_context_acquire()/aio_context_release() calls still remain after this series. They surround API calls that invoke AIO_WAIT_WHILE() and therefore still rely on the AioContext lock for now.
Stefan Hajnoczi (4):
scsi: only access SCSIDevice->requests from one thread
virtio-scsi: don't lock AioContext around
virtio_queue_aio_attach_host_notifier()
scsi: don't lock AioContext in I/O code path
dma-helpers: don't lock AioContext in dma_blk_cb()
include/hw/scsi/scsi.h | 7 +- hw/scsi/scsi-bus.c | 180 ++++++++++++++++++++++---------- hw/scsi/scsi-disk.c | 23 ---- hw/scsi/scsi-generic.c | 20 +--- hw/scsi/virtio-scsi-dataplane.c | 8 +- system/dma-helpers.c | 7 +- 6 files changed, 136 insertions(+), 109 deletions(-)
Signature · 1 line
2.43.0