[PATCH][nandsim] FIX RAM wasting via kmalloc
Artem Bityutskiy
dedekind at infradead.org
Wed Oct 22 11:49:06 EDT 2008
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 at infradead.org>
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
More information about the linux-mtd
mailing list