Am 04.05.2023 um 21:53 hat Stefan Hajnoczi geschrieben: > v5: > - Use atomic accesses for in_flight counter in vhost-user-server.c [Kevin] > - Stash SCSIDevice id/lun values for VIRTIO_SCSI_T_TRANSPORT_RESET event > before unrealizing the SCSIDevice [Kevin] > - Keep vhost-user-blk export .detach() callback so ctx is set to NULL [Kevin] > - Narrow BdrvChildClass and BlockDriver drained_{begin/end/poll} callbacks > from > IO_OR_GS_CODE() to GLOBAL_STATE_CODE() [Kevin] > - Include Kevin's "block: Fix use after free in blockdev_mark_auto_del()" to > fix a latent bug that was exposed by this series > > v4: > - Remove external_disable_cnt variable [Philippe] > - Add Patch 1 to fix assertion failure in .drained_end() -> > blk_get_aio_context() > v3: > - Resend full patch series. v2 was sent in the middle of a git rebase and was > missing patches. [Eric] > - Apply Reviewed-by tags. > v2: > - Do not rely on BlockBackend request queuing, implement .drained_begin/end() > instead in xen-block, virtio-blk, and virtio-scsi [Paolo] > - Add qdev_is_realized() API [Philippe] > - Add patch to avoid AioContext lock around blk_exp_ref/unref() [Paolo] > - Add patch to call .drained_begin/end() from main loop thread to simplify > callback implementations > > The aio_disable_external() API temporarily suspends file descriptor monitoring > in the event loop. The block layer uses this to prevent new I/O requests being > submitted from the guest and elsewhere between bdrv_drained_begin() and > bdrv_drained_end(). > > While the block layer still needs to prevent new I/O requests in drained > sections, the aio_disable_external() API can be replaced with > .drained_begin/end/poll() callbacks that have been added to BdrvChildClass and > BlockDevOps. > > This newer .bdrained_begin/end/poll() approach is attractive because it works > without specifying a specific AioContext. The block layer is moving towards > multi-queue and that means multiple AioContexts may be processing I/O > simultaneously. > > The aio_disable_external() was always somewhat hacky. It suspends all file > descriptors that were registered with is_external=true, even if they have > nothing to do with the BlockDriverState graph nodes that are being drained. > It's better to solve a block layer problem in the block layer than to have an > odd event loop API solution. > > The approach in this patch series is to implement BlockDevOps > .drained_begin/end() callbacks that temporarily stop file descriptor handlers. > This ensures that new I/O requests are not submitted in drained sections.
Patches 2-16: Reviewed-by: Kevin Wolf <kw...@redhat.com>