[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 3/4] virtio-blk: Use aio_set_io_event_notifi
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [RFC PATCH 3/4] virtio-blk: Use aio_set_io_event_notifier in dataplane |
Date: |
Wed, 27 May 2015 06:10:19 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 05/27/2015 01:19 AM, Fam Zheng wrote:
> Currently the host notifier is checked by all aio_poll, which is not
> safe. For example, in a qmp transaction that takes snapshots or starts
> drive-backup on multiple dataplane disks, the atomicity could be broken:
> There could be one or more bdrv_drain_all() calls in each transaction
> opeartion, which will unconditinally calls one or more aio_poll on the
s/opeartion/operation/
s/unconditinally calls/unconditionally call/
> AioContext:
>
> qmp transaction
> backup A prepare
> ...
> bdrv_drain_all()
> aio_poll(A)
> aio_poll(B)
> aio_poll(C)
> ...
> ...
> backup B prepare
> ...
> bdrv_drain_all()
> aio_poll(A)
> aio_poll(B)
> -> aio_poll(C)
> ...
> snapshot C prepare
> ...
> bdrv_drain_all()
> aio_poll(A)
> aio_poll(B)
> aio_poll(C)
> ...
>
> If the aio_poll(C) in the middle receives a new virtio-blk request from
> ioeventfd, a new request will be submitted to C, then snapshot C is
> inconsistent.
>
> To avoid that, use aio_set_io_event_notifier so the behavior is the same
> as in main loop.
>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> hw/block/dataplane/virtio-blk.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
again, letting others comment on the technical merits
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll(), Fam Zheng, 2015/05/27
- [Qemu-devel] [RFC PATCH 1/4] aio-posix: Introduce aio_set_io_event_notifier, Fam Zheng, 2015/05/27
- [Qemu-devel] [RFC PATCH 2/4] aio-win32: Implement aio_set_io_event_notifier, Fam Zheng, 2015/05/27
- [Qemu-devel] [RFC PATCH 3/4] virtio-blk: Use aio_set_io_event_notifier in dataplane, Fam Zheng, 2015/05/27
- Re: [Qemu-devel] [RFC PATCH 3/4] virtio-blk: Use aio_set_io_event_notifier in dataplane,
Eric Blake <=
- [Qemu-devel] [RFC PATCH 4/4] virtio-scsi-dataplane: User aio_set_io_event_notifier, Fam Zheng, 2015/05/27
- Re: [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll(), Paolo Bonzini, 2015/05/27
- Re: [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll(), Fam Zheng, 2015/05/27
- Re: [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll(), Paolo Bonzini, 2015/05/28
- Re: [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll(), Fam Zheng, 2015/05/28
- Re: [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll(), Paolo Bonzini, 2015/05/28
- Re: [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll(), Fam Zheng, 2015/05/28
- Re: [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll(), Paolo Bonzini, 2015/05/28
- Re: [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll(), Fam Zheng, 2015/05/28
- Re: [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll(), Paolo Bonzini, 2015/05/28