[PATCH][nandsim]Fix RAM wasting via kmalloc (take 2)
dedekind at infradead.org
Thu Nov 13 08:06:02 EST 2008
On Wed, 2008-10-29 at 13:14 +0000, 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.
Would you please send a version which checks return pointer of
kmem_cache_alloc() for NULL?
Artem Bityutskiy (Битюцкий Артём)
More information about the linux-mtd