From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxHTX-0001qF-Dw for qemu-devel@nongnu.org; Tue, 26 May 2015 12:13:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxHTT-0003xH-Iy for qemu-devel@nongnu.org; Tue, 26 May 2015 12:13:07 -0400 Message-ID: <55649B83.7060900@redhat.com> Date: Tue, 26 May 2015 10:12:51 -0600 From: Eric Blake MIME-Version: 1.0 References: <74e0e0ce58935bf1c285bf484e8f3beb0e3c8f66.1431967209.git.berto@igalia.com> <55649AE3.3070404@redhat.com> In-Reply-To: <55649AE3.3070404@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RAoVKlGse5rsWib8ExRFxfr457chFitlB" Subject: Re: [Qemu-devel] [PATCH 3/3] qcow2: reorder fields in Qcow2CachedTable to reduce padding List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , Alberto Garcia , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RAoVKlGse5rsWib8ExRFxfr457chFitlB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/26/2015 10:10 AM, Max Reitz wrote: > On 18.05.2015 18:48, Alberto Garcia wrote: >> Changing the current ordering saves 8 bytes per cache entry in x86_64.= >=20 > Hm, not seven? >=20 >> Signed-off-by: Alberto Garcia >> --- >> block/qcow2-cache.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c >> index a215f5b..43590ff 100644 >> --- a/block/qcow2-cache.c >> +++ b/block/qcow2-cache.c >> @@ -31,9 +31,9 @@ >> typedef struct Qcow2CachedTable { >> int64_t offset; >> - bool dirty; >> uint64_t lru_counter; >> int ref; >> + bool dirty; >> } Qcow2CachedTable; >> struct Qcow2Cache { >=20 > With "7" above, or an explanation why it actually is 8: Old layout: 0-7 offset 8 dirty 9-15 padding 16-23 lru_counter 24-27 dirty 28-31 padding New layout: 0-7 offset 8-15 lru_counter 16-19 ref 20 dirty 21-23 padding It indeed saves 8 bytes. >=20 > Reviewed-by: Max Reitz >=20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --RAoVKlGse5rsWib8ExRFxfr457chFitlB 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/ iQEcBAEBCAAGBQJVZJuDAAoJEKeha0olJ0Nqey4H/1VNPRVV3Luouh6ACxkC9KiZ DkIdNaN9APa85Q/v9BJ66KC4ihuOecJgV4/67lt1Ta7HjeDLiWiQ0FSv8jXQJM1j t/U+s62v581emtWuwOQDwkn6Axpn06bsBkORpjDut88ebr0EUq6sdyhF+ji7MKTh uM8hBRUtME/FijaG8OOqeiD3rId5CrR+cVieP7Rya2yAqYn+g3PXhsvRIF5IXIKo PtC8nCfdhiXZsou59N05d5tL21jyEIW4cDj2eqbDOXsh25HvSJwnlMPVJjKgEtfC ZmBoDM49vTPUcnMW5Zx833DDHPtfiJDVphgn9MhaOKQe3DcbJE6+JDnXusmbTYs= =o/xk -----END PGP SIGNATURE----- --RAoVKlGse5rsWib8ExRFxfr457chFitlB--