diff options
| author | Michal Hocko <[email protected]> | 2011-03-23 16:42:40 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2011-03-23 19:46:32 -0700 |
| commit | dde79e005a769d800166687c9e00d50d93e411ff (patch) | |
| tree | a38166f535b48063bd680deb64edbedf4395cfed /tools/perf/scripts/python/syscall-counts.py | |
| parent | 4be4489feae6da890765cc1bdc1af5e4f8c4b75f (diff) | |
page_cgroup: reduce allocation overhead for page_cgroup array for CONFIG_SPARSEMEM
Currently we are allocating a single page_cgroup array per memory section
(stored in mem_section->base) when CONFIG_SPARSEMEM is selected. This is
correct but memory inefficient solution because the allocated memory
(unless we fall back to vmalloc) is not kmalloc friendly:
- 32b - 16384 entries (20B per entry) fit into 327680B so the
524288B slab cache is used
- 32b with PAE - 131072 entries with 2621440B fit into 4194304B
- 64b - 32768 entries (40B per entry) fit into 2097152 cache
This is ~37% wasted space per memory section and it sumps up for the whole
memory. On a x86_64 machine it is something like 6MB per 1GB of RAM.
We can reduce the internal fragmentation by using alloc_pages_exact which
allocates PAGE_SIZE aligned blocks so we will get down to <4kB wasted
memory per section which is much better.
We still need a fallback to vmalloc because we have no guarantees that we
will have a continuous memory of that size (order-10) later on during the
hotplug events.
[[email protected]: do not define unused free_page_cgroup() without memory hotplug]
Signed-off-by: Michal Hocko <[email protected]>
Cc: Dave Hansen <[email protected]>
Acked-by: KAMEZAWA Hiroyuki <[email protected]>
Cc: Balbir Singh <[email protected]>
Signed-off-by: Johannes Weiner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
0 files changed, 0 insertions, 0 deletions