From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqIpb-0005y2-FZ for qemu-devel@nongnu.org; Thu, 07 May 2015 06:15:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqIpW-0003v1-GL for qemu-devel@nongnu.org; Thu, 07 May 2015 06:15:03 -0400 Date: Thu, 7 May 2015 11:14:55 +0100 From: Stefan Hajnoczi Message-ID: <20150507101455.GE13985@stefanha-thinkpad.redhat.com> References: <9947b50525d2d06d9a9c0bacb11cab8a9710ede1.1430919406.git.berto@igalia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lteA1dqeVaWQ9QQl" Content-Disposition: inline In-Reply-To: <9947b50525d2d06d9a9c0bacb11cab8a9710ede1.1430919406.git.berto@igalia.com> Subject: Re: [Qemu-devel] [PATCH 1/7] qcow2: use one single memory block for the L2/refcount cache tables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org, qemu-block@nongnu.org --lteA1dqeVaWQ9QQl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 06, 2015 at 04:39:25PM +0300, Alberto Garcia wrote: > The qcow2 L2/refcount cache contains one separate table for each cache > entry. Doing one allocation per table adds unnecessary overhead and it > also requires us to store the address of each table separately. >=20 > Since the size of the cache is constant during its lifetime, it's > better to have an array that contains all the tables using one single > allocation. >=20 > In my tests measuring freshly created caches with sizes 128MB (L2) and > 32MB (refcount) this uses around 10MB of RAM less. >=20 > Signed-off-by: Alberto Garcia > --- > block/qcow2-cache.c | 55 ++++++++++++++++++++++++--------------------= ------ > block/qcow2-cluster.c | 12 +++++------ > block/qcow2-refcount.c | 8 +++++--- > block/qcow2.h | 3 ++- > 4 files changed, 39 insertions(+), 39 deletions(-) Reviewed-by: Stefan Hajnoczi --lteA1dqeVaWQ9QQl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVSzsfAAoJEJykq7OBq3PIjCkH/2/R/yJXyruIIk5QZWkYDXwQ AyhbqrhO0yE+y2wTiZMAd/G+IKjJkGCZKBepmY3fBZ9WfGkpvWT5++uxkKesGu5B eUAs2PJLXwBO+AyTy2VWwRGgrbSfdHLkyufQQbQkrFa/2ehPeRYfjlEzjEGIS6Gl EZeVheLd3vp5vrDvFVnxkHp6/qVm4rz4cygqhPDb8qA1WhYp6CYncnaOZPb4mTzM T385+Nh/79IF6x0umM8APEeJ35KeE8w5JAQkUSpmn1uNH3L1JLTreE6zriH5TU52 vt0ndKUOu72r+95lAWd4Ux0IDEBtN9Ei1xUAxBMDRahBemjbWr5TvgUSalZXl/I= =H+/g -----END PGP SIGNATURE----- --lteA1dqeVaWQ9QQl--