From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGT50-0008QT-1T for qemu-devel@nongnu.org; Fri, 24 Jun 2016 11:31:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGT4y-00082u-Qo for qemu-devel@nongnu.org; Fri, 24 Jun 2016 11:31:37 -0400 References: <1466780802-30424-1-git-send-email-den@openvz.org> <1466780802-30424-2-git-send-email-den@openvz.org> From: Eric Blake Message-ID: <576D524D.9020400@redhat.com> Date: Fri, 24 Jun 2016 09:31:25 -0600 MIME-Version: 1.0 In-Reply-To: <1466780802-30424-2-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ViJeX5gGljLmK0eNvKoNbWlWj4tgEejcW" Subject: Re: [Qemu-devel] [PATCH 1/3] block: ignore flush requests when storage is clean List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Evgeny Yakovlev , Max Reitz , Stefan Hajnoczi , John Snow This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ViJeX5gGljLmK0eNvKoNbWlWj4tgEejcW From: Eric Blake To: "Denis V. Lunev" , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Evgeny Yakovlev , Max Reitz , Stefan Hajnoczi , John Snow Message-ID: <576D524D.9020400@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/3] block: ignore flush requests when storage is clean References: <1466780802-30424-1-git-send-email-den@openvz.org> <1466780802-30424-2-git-send-email-den@openvz.org> In-Reply-To: <1466780802-30424-2-git-send-email-den@openvz.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/24/2016 09:06 AM, Denis V. Lunev wrote: > From: Evgeny Yakovlev >=20 > Some guests (win2008 server for example) do a lot of unnecessary > flushing when underlying media has not changed. This adds additional > overhead on host when calling fsync/fdatasync. >=20 > This change introduces a dirty flag in BlockDriverState which is set > in bdrv_set_dirty and is checked in bdrv_co_flush. This allows us to > avoid unnesessary flushing when storage is clean. s/unnesessary/unnecessary/ (I pointed this out against v2 https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg05817.html, which makes me wonder if anything else was missed) >=20 > The problem with excessive flushing was found by a performance test > which does parallel directory tree creation (from 2 processes). > Results improved from 0.424 loops/sec to 0.432 loops/sec. > Each loop creates 10^3 directories with 10 files in each. >=20 > Signed-off-by: Evgeny Yakovlev > Signed-off-by: Denis V. Lunev > CC: Kevin Wolf > CC: Max Reitz > CC: Stefan Hajnoczi > CC: Fam Zheng > CC: John Snow > --- > +++ b/include/block/block_int.h > @@ -418,6 +418,8 @@ struct BlockDriverState { > int sg; /* if true, the device is a /dev/sg* */ > int copy_on_read; /* if true, copy read backing sectors into image= > note this is a reference count */ > + > + bool dirty; > bool probed; > =20 Conflicts with the current state of Kevin's block branch (due to my reordering and conversion of bool parameters); so you'll want to rebase. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ViJeX5gGljLmK0eNvKoNbWlWj4tgEejcW 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/ iQEcBAEBCAAGBQJXbVJNAAoJEKeha0olJ0Nqk9UH/RC4+dcfble4g3eVZJIXDLxx 5xAPGReFfA8GXsmPPlVPbdFMS71rUEKGo9eHSoYqYTXNoYsI+w/Php/q7kpKDoyc es1EmGjKQqzbOGDRTHS+vZEwXT7kmEuhvJPIxSu70AonpH9NJ8P0fmx9d/oqf0qA BmQ3yW6tsvs8+T8B2bWWuLQsaBpEofErxn0DlxJR9lvtEMuKdDxWw3BDIggtqIu3 xZTp6iSwff2x6bDxV3yNDwFyEiULLeQZdZWHetcPr4/42X4MrrwXHzD7ki8HzLif r8VHPdl6+j9ckbayzZuF/nrEt0wfVldsrrAVH94czACZISiVJgSKugHa2mOjJm0= =55kQ -----END PGP SIGNATURE----- --ViJeX5gGljLmK0eNvKoNbWlWj4tgEejcW--