From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvraF-0005Su-EV for qemu-devel@nongnu.org; Thu, 17 Jan 2013 10:40:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvraE-00032W-09 for qemu-devel@nongnu.org; Thu, 17 Jan 2013 10:40:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvraD-00032S-Kb for qemu-devel@nongnu.org; Thu, 17 Jan 2013 10:40:49 -0500 Message-ID: <50F81B63.2050009@redhat.com> Date: Thu, 17 Jan 2013 08:40:19 -0700 From: Eric Blake MIME-Version: 1.0 References: <1358353508-5369-1-git-send-email-benoit@irqsave.net> <1358353508-5369-13-git-send-email-benoit@irqsave.net> <50F70924.90904@redhat.com> <20130117111159.GA3448@irqsave.net> In-Reply-To: <20130117111159.GA3448@irqsave.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2DFKPMBRUSTTEQKTTBCSP" Subject: Re: [Qemu-devel] [RFC V1 12/14] qcow2: Add qcow2_dedup_update_metrics to compute dedup RAM usage. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2DFKPMBRUSTTEQKTTBCSP Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/17/2013 04:11 AM, Beno=C3=AEt Canet wrote: > Le Wednesday 16 Jan 2013 =C3=A0 13:10:12 (-0700), Eric Blake a =C3=A9cr= it : >> On 01/16/2013 09:25 AM, Beno=C3=AEt Canet wrote: >>> --- >>> block/qcow2-dedup.c | 13 +++++++++++++ >>> block/qcow2.h | 1 + >>> 2 files changed, 14 insertions(+) >>> >>> diff --git a/block/qcow2-dedup.c b/block/qcow2-dedup.c >>> index db23b71..4305746 100644 >>> --- a/block/qcow2-dedup.c >>> +++ b/block/qcow2-dedup.c >>> @@ -1311,3 +1311,16 @@ void qcow2_dedup_close(BlockDriverState *bs) >>> { >>> qcow2_dedup_free(bs); >>> } >>> + >>> +#define GTREE_NODE_SIZE sizeof(int) * 5 >> >> Improperly parenthesized. Also, this feels like a magic number, is >> there an actual sizeof(struct) you could use instead of hand-computing= >> how much is used per node? >=20 > No the glib implementation totally hide it's structures. Also, are you sure that this value is correct on both 32-bit and 64-bit machines, or does a gtree node include a void* which changes how much memory it uses based on platform? Even adding a comment pointing to the internal glib implementation that you were copying from would be helpful, so that it doesn't feel quite so magic. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2DFKPMBRUSTTEQKTTBCSP 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.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ+BtjAAoJEKeha0olJ0Nqi/sIAKi8BUTppsR3B+eJifxS7rHT rXj97DfHdgBG1KjGUOKJjTedil4giUniCY9/jsAtH5GEGj/BxalpuaR+V3rl9Udz 8b9f1aOwboqRI2WH92N402vnLMYVJQsarnpmJFnd5Kq0OuCdHhIHLhcpa3VMwIkk MUzZq8TsQ2lsTaBCGCW9l7fOF5oKCi0MVbqhSlUm+Cv70cZDy3uSCksCnELPBxzs 52URRySiShTgAkvNoVZ4+J/rrzjAqBg6X9zApUung31iG9+jrGBxaCA98h5Hb7mB 0Q6knf1/rkO++A6n+zaQtgYQ1qijAHKqaW/87YY9yygrKiWO/fPpNVxsL3bJnGI= =3qOs -----END PGP SIGNATURE----- ------enig2DFKPMBRUSTTEQKTTBCSP--