From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxaAO-0002wY-If for qemu-devel@nongnu.org; Wed, 27 May 2015 08:10:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxaAK-00074J-6b for qemu-devel@nongnu.org; Wed, 27 May 2015 08:10:36 -0400 Message-ID: <5565B42B.5020107@redhat.com> Date: Wed, 27 May 2015 06:10:19 -0600 From: Eric Blake MIME-Version: 1.0 References: <1432711146-28405-1-git-send-email-famz@redhat.com> <1432711146-28405-4-git-send-email-famz@redhat.com> In-Reply-To: <1432711146-28405-4-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="N3c9ggv7Gg6dVwlNf2xMQTJaiQqv9XepU" Subject: Re: [Qemu-devel] [RFC PATCH 3/4] virtio-blk: Use aio_set_io_event_notifier in dataplane List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, "Michael S. Tsirkin" , Stefan Weil , Stefan Hajnoczi , Paolo Bonzini This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --N3c9ggv7Gg6dVwlNf2xMQTJaiQqv9XepU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: >=20 > 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) > ... >=20 > 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. >=20 > To avoid that, use aio_set_io_event_notifier so the behavior is the sam= e > as in main loop. >=20 > Signed-off-by: Fam Zheng > --- > hw/block/dataplane/virtio-blk.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 again, letting others comment on the technical merits --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --N3c9ggv7Gg6dVwlNf2xMQTJaiQqv9XepU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVZbQsAAoJEKeha0olJ0NqsVUH/AqbZLw+AMlWYQRfyNypkOUZ HJuihPDB9WMtyzfnmivzUQlYWPAA09KsTV035HfSKYsooEbi/4mQ132+ygAzNVbh SD1D4naTdMwhZJTdin1ZoliCZHZ1EhyL4RsZvJPFb78GFEWKX+WQEnfztPc3unIh pdAWXh/fBHNej/LI0D85S9XyJQgkBR2etQ0giLL2qTsdDldwoADOpxFjzMgCLOwZ Azdc5ci5kiqb+8lx93rsp+WTRALnpHdaHLbGQjD9FZc8mBzewy0c/m04uPnxLurG pP7GuEazfi0xL7YYHF3nHb1hWl5hwXVsXno6b0gl59ysJ7Jk/IH2aWnc70u9ISQ= =hd2v -----END PGP SIGNATURE----- --N3c9ggv7Gg6dVwlNf2xMQTJaiQqv9XepU--