Am 08/11/2022 um 22:19 schrieb Stefan Hajnoczi:
> From: Emanuele Giuseppe Esposito <eespo...@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 <eespo...@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com>
> Message-Id: <20220609143727.1151816-2-eespo...@redhat.com>
>


Reviewed-by: Emanuele Giuseppe Esposito <eespo...@redhat.com>


Reply via email to