[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/4] scsi: only access SCSIDevice->requests from one thread
|
From: |
Eric Blake |
|
Subject: |
Re: [PATCH 1/4] scsi: only access SCSIDevice->requests from one thread |
|
Date: |
Mon, 27 Nov 2023 09:14:51 -0600 |
|
User-agent: |
NeoMutt/20231103 |
On Thu, Nov 23, 2023 at 02:49:28PM -0500, Stefan Hajnoczi wrote:
> Stop depending on the AioContext lock and instead access
> SCSIDevice->requests from only one thread at a time:
> - When the VM is running only the BlockBackend's AioContext may access
> the requests list.
> - When the VM is stopped only the main loop may access the requests
> list.
>
> These constraints protect the requests list without the need for locking
> in the I/O code path.
>
> Note that multiple IOThreads are not supported yet because the code
> assumes all SCSIRequests are executed from a single AioContext. Leave
> that as future work.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
> include/hw/scsi/scsi.h | 7 +-
> hw/scsi/scsi-bus.c | 174 ++++++++++++++++++++++++++++-------------
> 2 files changed, 124 insertions(+), 57 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
- [PATCH 0/4] scsi: eliminate AioContext lock, Stefan Hajnoczi, 2023/11/23
- [PATCH 1/4] scsi: only access SCSIDevice->requests from one thread, Stefan Hajnoczi, 2023/11/23
- Re: [PATCH 1/4] scsi: only access SCSIDevice->requests from one thread,
Eric Blake <=
- [PATCH 2/4] virtio-scsi: don't lock AioContext around virtio_queue_aio_attach_host_notifier(), Stefan Hajnoczi, 2023/11/23
- [PATCH 3/4] scsi: don't lock AioContext in I/O code path, Stefan Hajnoczi, 2023/11/23
- [PATCH 4/4] dma-helpers: don't lock AioContext in dma_blk_cb(), Stefan Hajnoczi, 2023/11/23
- Re: [PATCH 0/4] scsi: eliminate AioContext lock, Stefan Hajnoczi, 2023/11/23