From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
"David Hildenbrand" <david@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Peter Xu" <peterx@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Fam Zheng" <fam@euphon.net>,
kwolf@redhat.com, qemu-block@nongnu.org
Subject: Re: [PATCH 0/4] scsi: eliminate AioContext lock
Date: Thu, 23 Nov 2023 14:57:57 -0500 [thread overview]
Message-ID: <20231123195757.GA172762@fedora> (raw)
In-Reply-To: <20231123194931.171598-1-stefanha@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]
On Thu, Nov 23, 2023 at 02:49:27PM -0500, Stefan Hajnoczi wrote:
> 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(-)
CCing Kevin and qemu-block
>
> --
> 2.42.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2023-11-23 19:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Stefan Hajnoczi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231123195757.GA172762@fedora \
--to=stefanha@redhat.com \
--cc=david@redhat.com \
--cc=fam@euphon.net \
--cc=kwolf@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).