]> git.proxmox.com Git - mirror_qemu.git/commit
aio-wait: avoid AioContext lock in aio_wait_bh_oneshot()
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 4 Apr 2023 15:33:07 +0000 (11:33 -0400)
committerKevin Wolf <kwolf@redhat.com>
Wed, 10 May 2023 12:15:13 +0000 (14:15 +0200)
commit3edf660a9155848d1d7bc6ad2586ceb0285105e3
tree0c2d12be814859368da9f478aa300b20fb7cae0f
parent17ac39c3e726173f737bb6cd898c160b406532d4
aio-wait: avoid AioContext lock in aio_wait_bh_oneshot()

There is no need for the AioContext lock in aio_wait_bh_oneshot().
It's easy to remove the lock from existing callers and then switch from
AIO_WAIT_WHILE() to AIO_WAIT_WHILE_UNLOCKED() in aio_wait_bh_oneshot().

Document that the AioContext lock should not be held across
aio_wait_bh_oneshot(). Holding a lock across aio_poll() can cause
deadlock so we don't want callers to do that.

This is a step towards getting rid of the AioContext lock.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230404153307.458883-1-stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/dataplane/virtio-blk.c
hw/scsi/virtio-scsi-dataplane.c
include/block/aio-wait.h
util/aio-wait.c