mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 17:42:03 +02:00
mm/mm_init: drop overlap_memmap_init()
When ZONE_NORMAL and ZONE_MOVABLE could overlap because kernelcore=mirror didn't reduce the span of ZONE_NORMAL, initialization of the memory map had to skip overlapping pages during initialization of ZONE_MOVABLE to avoid double initialization of the same struct pages. Since kernelcore=mirror works now the same way as other variants of kernelcore=/movablecore=, and adjusts the span of ZONE_NORMAL, there can't be an overlap between ZONE_NORMAL and ZONE_MOVABLE. Remove overlap_memmap_init(). Co-developed-by: Wei Yang <richard.weiyang@gmail.com> Signed-off-by: Wei Yang <richard.weiyang@gmail.com> Reviewed-by: David Hildenbrand (Arm) <david@kernel.org> Link: https://patch.msgid.link/20260630072212.624305-3-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
This commit is contained in:
parent
eb0e5b6136
commit
f042b69ebb
24
mm/mm_init.c
24
mm/mm_init.c
|
|
@ -799,28 +799,6 @@ void __meminit init_deferred_page(unsigned long pfn, int nid)
|
|||
__init_deferred_page(pfn, nid);
|
||||
}
|
||||
|
||||
/* If zone is ZONE_MOVABLE but memory is mirrored, it is an overlapped init */
|
||||
static bool __meminit
|
||||
overlap_memmap_init(unsigned long zone, unsigned long *pfn)
|
||||
{
|
||||
static struct memblock_region *r __meminitdata;
|
||||
|
||||
if (mirrored_kernelcore && zone == ZONE_MOVABLE) {
|
||||
if (!r || *pfn >= memblock_region_memory_end_pfn(r)) {
|
||||
for_each_mem_region(r) {
|
||||
if (*pfn < memblock_region_memory_end_pfn(r))
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (*pfn >= memblock_region_memory_base_pfn(r) &&
|
||||
memblock_is_mirror(r)) {
|
||||
*pfn = memblock_region_memory_end_pfn(r);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Only struct pages that correspond to ranges defined by memblock.memory
|
||||
* are zeroed and initialized by going through __init_single_page() during
|
||||
|
|
@ -907,8 +885,6 @@ void __meminit memmap_init_range(unsigned long size, int nid, unsigned long zone
|
|||
* function. They do not exist on hotplugged memory.
|
||||
*/
|
||||
if (context == MEMINIT_EARLY) {
|
||||
if (overlap_memmap_init(zone, &pfn))
|
||||
continue;
|
||||
if (defer_init(nid, pfn, zone_end_pfn)) {
|
||||
deferred_struct_pages = true;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user