Re: [PATCH][nandsim] FIX RAM wasting via kmalloc

Artem Bityutskiy
2008-10-22T15:49:06Z

Hi Alexey,

thanks for the patch.

On Wed, 2008-10-22 at 16:33 +0100, Alexey Korolev wrote:
> Hi All,
>
> Nandsim consumes ~2x more RAM than the density of simulated device.
> It becomes critical if we need to simulate 256MB NAND and run stress tests
> on it.
>
> We investigated the reasons. nandsim allocates space for pages using kmalloc
> function. The size of LP nand page is 2112 bytes.
> kmalloc gets space from slab pools by chunks 2^n. So if we need to kmalloc
> 2112 bytes, 4096 bytes will be consumed by system.
> The best way to avoid this issue would be using kmem_cache allocations. AFAIK
> this mechanism specially designed to handle cases when arrays of allocations
> are used.

Acked-by: Artem Bityutskiy <dedekind@infradead.org>