]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: introduce memmap_alloc() to unify memory map allocation
authorMike Rapoport <rppt@linux.ibm.com>
Mon, 23 Aug 2021 23:59:26 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:34:05 +0000 (09:34 +1000)
commit30a333c706c4a180eb0c085aecb566fe9bc7a3de
tree9b1fe63bc83ebc4b6a2610debe71938221c0e7a0
parent28c6e7e5a91e3809052c7b41aa2b9e128da2d714
mm: introduce memmap_alloc() to unify memory map allocation

There are several places that allocate memory for the memory map:
alloc_node_mem_map() for FLATMEM, sparse_buffer_init() and
__populate_section_memmap() for SPARSEMEM.

The memory allocated in the FLATMEM case is zeroed and it is never
poisoned, regardless of CONFIG_PAGE_POISON setting.

The memory allocated in the SPARSEMEM cases is not zeroed and it is
implicitly poisoned inside memblock if CONFIG_PAGE_POISON is set.

Introduce memmap_alloc() wrapper for memblock allocators that will be used
for both FLATMEM and SPARSEMEM cases and will makei memory map zeroing and
poisoning consistent for different memory models.

Link: https://lkml.kernel.org/r/20210714123739.16493-4-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Cc: Michal Simek <monstr@monstr.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/internal.h
mm/page_alloc.c
mm/sparse.c