Re: slab: too much allocated in bootstrap head arrays?

From: Christoph Lameter
Date: Tue Dec 13 2011 - 11:15:32 EST


On Mon, 12 Dec 2011, roel wrote:

> In mm/slab.c kmem_cache_init() at /* 4) Replace the bootstrap head arrays */
> it kmallocs *ptr and memcpy's with sizeof(struct arraycache_init). Is this
> correct or should it maybe be with sizeof(struct arraycache) instead?

Allocating with sizeof(struct arraycache) will only allocate the header of
the array cache and not reserve space for the pointers that are part of
it. It is always wrong.

Look at alloc_arraycache() for the proper way to use struct arraycache to
calculate the number of bytes needed.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/