diff options
| author | Michal Hocko <[email protected]> | 2019-11-30 17:54:27 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2019-12-01 12:59:05 -0800 |
| commit | 09dbcf422e9b791d2d43cad8c283d9bdaef019a9 (patch) | |
| tree | a5028886e50f486626e2fa6414cc9b3b6deddbda /tools/perf/scripts/python/bin/stackcollapse-report | |
| parent | 030eab4f9ffb469344c10a46bc02c5149db0a2a9 (diff) | |
mm/sparse.c: do not waste pre allocated memmap space
Vincent has noticed [1] that there is something unusual with the memmap
allocations going on on his platform
: I noticed this because on my ARM64 platform, with 1 GiB of memory the
: first [and only] section is allocated from the zeroing path while with
: 2 GiB of memory the first 1 GiB section is allocated from the
: non-zeroing path.
The underlying problem is that although sparse_buffer_init allocates
enough memory for all sections on the node sparse_buffer_alloc is not
able to consume them due to mismatch in the expected allocation
alignement. While sparse_buffer_init preallocation uses the PAGE_SIZE
alignment the real memmap has to be aligned to section_map_size() this
results in a wasted initial chunk of the preallocated memmap and
unnecessary fallback allocation for a section.
While we are at it also change __populate_section_memmap to align to the
requested size because at least VMEMMAP has constrains to have memmap
properly aligned.
[1] http://lkml.kernel.org/r/[email protected]
[[email protected]: tweak layout, per David]
Link: http://lkml.kernel.org/r/[email protected]
Fixes: 35fd1eb1e821 ("mm/sparse: abstract sparse buffer allocations")
Signed-off-by: Michal Hocko <[email protected]>
Reported-by: Vincent Whitchurch <[email protected]>
Debugged-by: Vincent Whitchurch <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Cc: Pavel Tatashin <[email protected]>
Cc: Oscar Salvador <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions