qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] scsi: eliminate AioContext lock
@ 2023-11-23 19:49 Stefan Hajnoczi
  2023-11-23 19:49 ` [PATCH 1/4] scsi: only access SCSIDevice->requests from one thread Stefan Hajnoczi
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Stefan Hajnoczi @ 2023-11-23 19:49 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, David Hildenbrand,
	Philippe Mathieu-Daudé, Peter Xu, Paolo Bonzini, Fam Zheng,
	Stefan Hajnoczi

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              | 174 ++++++++++++++++++++++----------
 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, 130 insertions(+), 109 deletions(-)

-- 
2.42.0



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-12-06 16:25 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-23 19:49 [PATCH 0/4] scsi: eliminate AioContext lock Stefan Hajnoczi
2023-11-23 19:49 ` [PATCH 1/4] scsi: only access SCSIDevice->requests from one thread Stefan Hajnoczi
2023-11-27 15:14   ` Eric Blake
2023-12-01 16:03   ` Kevin Wolf
2023-12-04 16:30     ` Stefan Hajnoczi
2023-12-05 10:00       ` Kevin Wolf
2023-12-06 16:25         ` Stefan Hajnoczi
2023-11-23 19:49 ` [PATCH 2/4] virtio-scsi: don't lock AioContext around virtio_queue_aio_attach_host_notifier() Stefan Hajnoczi
2023-11-27 15:21   ` Eric Blake
2023-12-04 15:37     ` Stefan Hajnoczi
2023-12-01 16:11   ` Kevin Wolf
2023-11-23 19:49 ` [PATCH 3/4] scsi: don't lock AioContext in I/O code path Stefan Hajnoczi
2023-11-27 15:58   ` Eric Blake
2023-12-01 16:38   ` Kevin Wolf
2023-11-23 19:49 ` [PATCH 4/4] dma-helpers: don't lock AioContext in dma_blk_cb() Stefan Hajnoczi
2023-11-27 18:46   ` Eric Blake
2023-12-01 16:48   ` Kevin Wolf
2023-11-23 19:57 ` [PATCH 0/4] scsi: eliminate AioContext lock Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).