]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
MTD: nandsim: use less RAM
authorAlexey Korolev <akorolev@infradead.org>
Thu, 13 Nov 2008 13:40:38 +0000 (13:40 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 10 Dec 2008 13:35:23 +0000 (13:35 +0000)
commit8a4c2495b142fe612b291a810d9e695f269c26db
treee68d387a13d82918c5d744040ff9bf0973230f80
parenta9fc8991883cdf029bd373a82cbc2d12a10799dd
MTD: nandsim: use less RAM

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.

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Tested-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/nandsim.c