Am 08/11/2022 um 22:19 schrieb Stefan Hajnoczi: > From: Emanuele Giuseppe Esposito <[email protected]> > > 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 <[email protected]> > Signed-off-by: Stefan Hajnoczi <[email protected]> > Message-Id: <[email protected]> > Reviewed-by: Emanuele Giuseppe Esposito <[email protected]>
- Re: [PATCH 3/8] virtio: categorize callbac... Emanuele Giuseppe Esposito
- [PATCH 2/8] block-backend: enable_write_cache s... Stefan Hajnoczi
- Re: [PATCH 2/8] block-backend: enable_writ... Emanuele Giuseppe Esposito
- [PATCH 4/8] virtio-blk: mark GLOBAL_STATE_CODE ... Stefan Hajnoczi
- Re: [PATCH 4/8] virtio-blk: mark GLOBAL_ST... Emanuele Giuseppe Esposito
- [PATCH 6/8] virtio-blk: remove unnecessary AioC... Stefan Hajnoczi
- Re: [PATCH 6/8] virtio-blk: remove unneces... Emanuele Giuseppe Esposito
- [PATCH 5/8] virtio-blk: mark IO_CODE functions Stefan Hajnoczi
- Re: [PATCH 5/8] virtio-blk: mark IO_CODE f... Emanuele Giuseppe Esposito
- [PATCH 1/8] virtio_queue_aio_attach_host_notifi... Stefan Hajnoczi
- Re: [PATCH 1/8] virtio_queue_aio_attach_ho... Emanuele Giuseppe Esposito
- [PATCH 8/8] virtio-blk: minimize virtio_blk_res... Stefan Hajnoczi
- Re: [PATCH 8/8] virtio-blk: minimize virti... Emanuele Giuseppe Esposito
- [PATCH 7/8] virtio-blk: don't acquire AioContex... Stefan Hajnoczi
- Re: [PATCH 7/8] virtio-blk: don't acquire ... Emanuele Giuseppe Esposito
