From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2gEk-00004y-Es for qemu-devel@nongnu.org; Thu, 03 Jul 2014 08:35:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2gEa-0005Tm-Cv for qemu-devel@nongnu.org; Thu, 03 Jul 2014 08:35:38 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:32913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2gEa-0005Tb-6a for qemu-devel@nongnu.org; Thu, 03 Jul 2014 08:35:28 -0400 Received: by mail-wi0-f181.google.com with SMTP id n3so2211573wiv.8 for ; Thu, 03 Jul 2014 05:35:27 -0700 (PDT) Date: Thu, 3 Jul 2014 14:35:17 +0200 From: Stefan Hajnoczi Message-ID: <20140703123517.GC28032@stefanha-thinkpad.redhat.com> References: <1404303528-7115-1-git-send-email-ming.lei@canonical.com> <1404303528-7115-4-git-send-email-ming.lei@canonical.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CblX+4bnyfN0pR09" Content-Disposition: inline In-Reply-To: <1404303528-7115-4-git-send-email-ming.lei@canonical.com> Subject: Re: [Qemu-devel] [PATCH v4 3/3] dataplane: submit I/O as a batch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei Cc: Kevin Wolf , Peter Maydell , Fam Zheng , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini --CblX+4bnyfN0pR09 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 02, 2014 at 08:18:48PM +0800, Ming Lei wrote: > diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-= blk.c > index c10b7b7..82bb276 100644 > --- a/hw/block/dataplane/virtio-blk.c > +++ b/hw/block/dataplane/virtio-blk.c > @@ -201,6 +201,9 @@ static void do_flush_cmd(VirtIOBlockDataPlane *s, Vir= tQueueElement *elem, > req->elem =3D elem; > req->inhdr =3D inhdr; > =20 > + /* flush IOs queued first */ > + bdrv_flush_io_queue(s->blk->conf.bs); > + > bdrv_aio_flush(s->blk->conf.bs, complete_flush, req); > } > =20 I looked back at previous email threads but I don't understand why this is necessary. bdrv_aio_flush() commits the disk write cache, that means _already completed_ writes will be on stable storage. However, it does not make any guarantees about in-flight writes. So this seems like a pointless call that can be dropped safely. Stefan --CblX+4bnyfN0pR09 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTtU4FAAoJEJykq7OBq3PIuysIAJ/ih1x5LDGOk9TCkkVf3z4Z jjmSJhxLAa8MS50/G+i8zmgQFvVU4bYECY21UfqkSAg7oEULgVynX1HfDsJQdqt+ 6luSN6danRnMvaOhvEIw0Qkf2I0tk7QiVxU3mJSGrJwe7sNXEV2YKfvG56QVfPfW h0+bE9nw0+nfST3dAe7te3lMfaz+WDjvG+1PXPYcoIdN4SIW9IkbZJNn4mCwWUN+ u+W6Ed8v0yO/zYbATHHqq+BcYP8ewBK9HCufGo8Lp0GM2VSvtnTj8BHatTKt0iQh P9yL4zQSqN4v8Xn120Bn1SSGb06U+bF01QrFkbPLuoxoDh/PrqjBhhBoL6dGWD0= =a9H8 -----END PGP SIGNATURE----- --CblX+4bnyfN0pR09--