From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XosyS-0006pg-2Y for qemu-devel@nongnu.org; Thu, 13 Nov 2014 06:54:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XosyK-0001zc-2a for qemu-devel@nongnu.org; Thu, 13 Nov 2014 06:54:04 -0500 Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:41346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XosyJ-0001zR-S3 for qemu-devel@nongnu.org; Thu, 13 Nov 2014 06:53:56 -0500 Received: by mail-wg0-f48.google.com with SMTP id y19so5887319wgg.35 for ; Thu, 13 Nov 2014 03:53:55 -0800 (PST) Date: Thu, 13 Nov 2014 11:53:52 +0000 From: Stefan Hajnoczi Message-ID: <20141113115352.GR7462@stefanha-thinkpad.redhat.com> References: <201411070930569161961@sangfor.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MI2pJyvBeFc4alSb" Content-Disposition: inline In-Reply-To: <201411070930569161961@sangfor.com> Subject: Re: [Qemu-devel] [PATCH] qcow2-cache: conditionally call bdrv_flush() in qcow2_cache_flush() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhang Haoyu Cc: Kevin Wolf , qemu-devel , Stefan Hajnoczi --MI2pJyvBeFc4alSb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 07, 2014 at 09:30:59AM +0800, Zhang Haoyu wrote: > Needless to call bdrv_flush() in qcow2_cache_flush() > if no cache entry is dirty. Did you audit all qcow2 cache callers to make sure they don't rely on the cache flush? Maybe it's not safe to optimize it away if callers assume previously written data will be persisted as part of qcow2 cache flushing. We need to be very careful when optimizing out cache flushes so that we don't introduce data integrity problems. >=20 > Signed-off-by: Zhang Haoyu > --- > block/qcow2-cache.c | 24 +++++++++++++----------- > 1 file changed, 13 insertions(+), 11 deletions(-) Please post benchmark configuration and performance results, if you ran any. Data makes performance optimization patches much more convincing. --MI2pJyvBeFc4alSb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUZJvQAAoJEJykq7OBq3PIVnIH/3YBKDzIPIF+m06xV+NEvUJc AtkuQVBvFoHnYrQhunfsP9mebjjvrRYuk0sFDrsVjr82nVPmpE0WLuoJoWi81u8R 3MRUIX0gTSNerIj+vqoeENs4+teKrPVuiOopjNmGadxvld141OqCimltbO3lepDB g+Z3cBquPpqeYAhSABDAIP+2Rkn+sFr2ko/Aww5mpFgX5xlgB5zyclYkrD9ZvGJT KL4o2lYYuilJIYaTXtzElVXeKsI7Pmm60kVEbX6ujF4lQF5TNBnpQDEAPM2SgDRU zUu7srk+uzxUcn2RvWe23D61Q1sa6VpWMiaMUw6aEosBxu5wFzex/I3Z8PCJSFA= =Z46q -----END PGP SIGNATURE----- --MI2pJyvBeFc4alSb--