From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XccCv-0004KF-Bj for qemu-devel@nongnu.org; Fri, 10 Oct 2014 11:34:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XccCq-0005vY-DU for qemu-devel@nongnu.org; Fri, 10 Oct 2014 11:34:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XccCq-0005vS-4g for qemu-devel@nongnu.org; Fri, 10 Oct 2014 11:34:12 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9AFYBdt014205 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 10 Oct 2014 11:34:11 -0400 Message-ID: <5437FC72.5080404@redhat.com> Date: Fri, 10 Oct 2014 09:34:10 -0600 From: Eric Blake MIME-Version: 1.0 References: <1409088987-17207-1-git-send-email-mreitz@redhat.com> <1409088987-17207-4-git-send-email-mreitz@redhat.com> <5437D1E3.4070302@redhat.com> In-Reply-To: <5437D1E3.4070302@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VfFdQ3JtO4VLqqXAA6rXViEjCM1gEl1aA" Subject: Re: [Qemu-devel] [PATCH v12 03/14] qcow2: Optimize bdrv_make_empty() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VfFdQ3JtO4VLqqXAA6rXViEjCM1gEl1aA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/10/2014 06:32 AM, Eric Blake wrote: > On 08/26/2014 03:36 PM, Max Reitz wrote: >> bdrv_make_empty() is currently only called if the current image >> represents an external snapshot that has been committed to its base >> image; it is therefore unlikely to have internal snapshots. In this >> case, bdrv_make_empty() can be greatly sped up by emptying the L1 and >> refcount table (while having the dirty flag set) and creating a trivia= l >> refcount structure. >> >> If there are snapshots, fall back to the simple implementation (discar= d >> all clusters). Brain-wave... >> + /* Refcounts will be broken utterly */ >> + ret =3D qcow2_mark_dirty(bs); >=20 > qcow2_mark_dirty does assert(s->qcow_version >=3D 3). But this code ca= n > be reached when committing a qcow2 0.10 compat-level file, right? What if you use the fallback of the slower code on compat=3D0.10 files? It's no worse than it has always been, and after all, this patch is about adding an optimization, not adding new behavior. It's okay if the optimization is only usable on compat=3D1.1 files. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --VfFdQ3JtO4VLqqXAA6rXViEjCM1gEl1aA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUN/xyAAoJEKeha0olJ0Nq4ioH/08B9BX8TE32oYVZHq88rlyb pQJJMrZvFldBYCk0UgOHh46UVeE9ECgl9zy6oWT7VueLG8Cg2Cj4zLAILTrZy5CH YzOldMSJbauw+/Ls60V1lqPY+kth3ThO1ufNyJRMS+iX1aFm3qtPPhUM21ww/keJ GSNjVu2aownodLIt84FLs6IIkx8DOw9Cl9v4SFj+VLH06ffpBp/PuiGHAThho4ri nXhWv6zRYimqs2UCi03BDC7B+uCOP062oVqtTOYSp2enQ8C1QcUfgkbwZrMadEDd 75xZhYivqDlrQocN/NiXY/xYLIgjT1+EJkLxM/oQgd6/dfrWMTGAHFzv3Qw7/bA= =46sG -----END PGP SIGNATURE----- --VfFdQ3JtO4VLqqXAA6rXViEjCM1gEl1aA--