|
From: | Emanuele Giuseppe Esposito |
Subject: | Re: [PATCH 1/8] virtio_queue_aio_attach_host_notifier: remove AioContext lock |
Date: | Fri, 11 Nov 2022 13:17:42 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 |
Am 08/11/2022 um 22:19 schrieb Stefan Hajnoczi: > From: Emanuele Giuseppe Esposito <eesposit@redhat.com> > > virtio_queue_aio_attach_host_notifier() and > virtio_queue_aio_attach_host_notifier_nopoll() run always in the > main loop, so there is no need to protect them with AioContext > lock. > > On the other side, virtio_queue_aio_detach_host_notifier() runs > in a bh in the iothread context, but it is always scheduled > (thus serialized) by the main loop. Therefore removing the > AioContext lock is safe. > > In order to remove the AioContext lock it is necessary to switch > aio_wait_bh_oneshot() to AIO_WAIT_WHILE_UNLOCKED(). virtio-blk and > virtio-scsi are the only users of aio_wait_bh_oneshot() so it is > possible to make this change. > > For now bdrv_set_aio_context() still needs the AioContext lock. > > Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> > Message-Id: <20220609143727.1151816-2-eesposit@redhat.com> > Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
[Prev in Thread] | Current Thread | [Next in Thread] |