[RFC PATCH] page_cgroup: Reduce allocation overhead forpage_cgroup array for CONFIG_SPARSEMEM

From: Michal Hocko
Date: Wed Feb 23 2011 - 10:10:54 EST


Hi,

I have just noticed that memory cgroups consume a lot of 2MB slab
objects (8 objects per 1GB of RAM on x86_64 with SPARSEMEM). It turned
out that this memory is allocated for per memory sections page_cgroup
arrays.

If we consider that the array itself consume something above 1MB (but
still doesn't fit into 1MB kmalloc cache) it is rather big wasting of
(continous) memory (6MB per 1GB of RAM).


The patch below tries to fix this up. Any thoughts?
---