From: Eric Blake <eblake@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
Stefan Weil <sw@weilnetz.de>,
Stefan Hajnoczi <stefanha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
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 [thread overview]
Message-ID: <5565B42B.5020107@redhat.com> (raw)
In-Reply-To: <1432711146-28405-4-git-send-email-famz@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1718 bytes --]
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 <famz@redhat.com>
> ---
> 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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-05-27 12:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-27 7:19 [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll() Fam Zheng
2015-05-27 7:19 ` [Qemu-devel] [RFC PATCH 1/4] aio-posix: Introduce aio_set_io_event_notifier Fam Zheng
2015-05-27 12:07 ` Eric Blake
2015-05-27 7:19 ` [Qemu-devel] [RFC PATCH 2/4] aio-win32: Implement aio_set_io_event_notifier Fam Zheng
2015-05-27 7:19 ` [Qemu-devel] [RFC PATCH 3/4] virtio-blk: Use aio_set_io_event_notifier in dataplane Fam Zheng
2015-05-27 12:10 ` Eric Blake [this message]
2015-05-27 7:19 ` [Qemu-devel] [RFC PATCH 4/4] virtio-scsi-dataplane: User aio_set_io_event_notifier Fam Zheng
2015-05-27 9:38 ` [Qemu-devel] [RFC PATCH 0/4] aio: Don't poll ioeventfd in nested aio_poll() Paolo Bonzini
2015-05-28 1:46 ` Fam Zheng
2015-05-28 8:21 ` Paolo Bonzini
2015-05-28 11:16 ` Fam Zheng
2015-05-28 11:19 ` Paolo Bonzini
2015-05-28 11:49 ` Fam Zheng
2015-05-28 12:01 ` Paolo Bonzini
2015-05-28 12:26 ` Fam Zheng
2015-05-28 13:42 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5565B42B.5020107@redhat.com \
--to=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=sw@weilnetz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.