From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yqjou-0004JJ-1f for qemu-devel@nongnu.org; Fri, 08 May 2015 11:04:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yqjoq-0002u7-42 for qemu-devel@nongnu.org; Fri, 08 May 2015 11:04:07 -0400 Message-ID: <554CD030.6060908@redhat.com> Date: Fri, 08 May 2015 17:03:12 +0200 From: Max Reitz MIME-Version: 1.0 References: <9947b50525d2d06d9a9c0bacb11cab8a9710ede1.1430919406.git.berto@igalia.com> In-Reply-To: <9947b50525d2d06d9a9c0bacb11cab8a9710ede1.1430919406.git.berto@igalia.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-block] [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 , qemu-devel@nongnu.org Cc: Stefan Hajnoczi , qemu-block@nongnu.org On 06.05.2015 15:39, 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. > > 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. > > In my tests measuring freshly created caches with sizes 128MB (L2) and > 32MB (refcount) this uses around 10MB of RAM less. > > 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: Max Reitz