Re: [RFC Patch 0/3] mm/mm_init: fix and cleanup mirrored_kernelcore

From: David Hildenbrand (Arm)

Date: Thu Jun 25 2026 - 02:36:27 EST


On 6/23/26 11:23, Wei Yang wrote:
> When reviewing patch set "mm/memory_hotplug: optimize zone contiguous check
> when changing pfn range" [1], we notice mirrored_kernelcore introduced some
> special case to handle.
>
> While during the discussion and test, it shows current mirrored_kernelcore
> implementation breaks other memmap_init() behavior:
>
> * disturbs defer_init()
> * some Movable zone range would be initialized twice
>
> The reason is Zone Movable and Zone Normal overlaps and current logic doesn't
> handle it well.
>
> As Yuan shows in [2], physical overlapped zone seems not exist in practice. If
> remove the possibility of overlapped zone, problem could be solved. And also
> could benefit zone contiguous optimization, IIUC.
>
> Patch [1]: remove the overlapped zone, which fix the above two problem
> Patch [2]: remove overlap_memmap_init() as there is no overlapped zone, but
> record current double initialize problem for reference
> Patch [3]: remove absent pages calculation for mirrored_kernelcore
>
> [1]: https://lore.kernel.org/all/20260520093457.3719960-1-yuan1.liu@xxxxxxxxx/T/#u
> [2]: https://lore.kernel.org/all/20260520093457.3719960-1-yuan1.liu@xxxxxxxxx/T/#mb0bd07ffd562a5b029f0f07751e580ca339c5b51
>

IIUC, Mike will send an alternative.

--
Cheers,

David