Re: [PATCH 2/2] mm/mm_init: drop overlap_memmap_init()

From: Mike Rapoport

Date: Mon Jun 29 2026 - 07:48:52 EST


On Fri, Jun 26, 2026 at 09:29:52AM +0000, Wei Yang wrote:
> On Fri, Jun 26, 2026 at 10:40:32AM +0300, Mike Rapoport wrote:
> >Hi Wei,
> >
> >On Thu, Jun 25, 2026 at 09:58:47AM +0000, Wei Yang wrote:
> >> On Thu, Jun 25, 2026 at 10:39:40AM +0300, Mike Rapoport wrote:
> >> >From: "Mike Rapoport (Microsoft)" <rppt@xxxxxxxxxx>
> >> >
> >> >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().
> >> >
> >>
> >> Do you think this is valuable to mention the double init for the overlapped
> >> range?
> >
> >Not sure I follow.
> >We had this weird overlap_memmap_init() exactly to avoid double init.
> >
>
> Yes, this is really weird.
>
> As I described the detail in [1], before this change kernel would have
> overlapped zone range like:
>
> Normal [100000, 1c0000]
> Movable [140000, 1c0000]
>
> Which means [140000, 1c0000] belongs to both Normal and Movable.
> And memmap_init_range() would be called on this range twice for Normal and
> Movable respectively. And we want overlap_memmap_init() could skip init this
> to Normal. Because actually, the memory in this range belongs to Movable Zone.
>
> But overlap_memmap_init() only would skip for Zone Movable. This means when
> init to Zone Normal, it doesn't skip as we want. And when init to Zone
> Movable, we don't expect it to skip.

I'll add something along these lines into the cover letter and will merge
it as a merge commit.

Will send v2 soon.

> [1]: https://lore.kernel.org/linux-mm/20260623092351.13031-3-richard.weiyang@xxxxxxxxx/
>
> --
> Wei Yang
> Help you, Help me

--
Sincerely yours,
Mike.