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. > > 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 <be...@igalia.com> > --- > 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 <stefa...@redhat.com>
pgp5xbpXAYM8Q.pgp
Description: PGP signature