Re: [PATCH v8 1/3] mm/memory hotplug: Fix zone->contiguous always false when hotplug

From: Mike Rapoport

Date: Tue Jan 27 2026 - 01:53:45 EST


Hi,

On Sat, Jan 24, 2026 at 08:18:39PM +0800, Li, Tianyou wrote:
> On 1/22/2026 7:16 PM, Mike Rapoport wrote:
> > On Tue, Jan 20, 2026 at 10:33:44PM +0800, Tianyou Li wrote:
> > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> > > index a63ec679d861..c8f492b5daf0 100644
> > > --- a/mm/memory_hotplug.c
> > > +++ b/mm/memory_hotplug.c
> > > @@ -782,8 +782,6 @@ void move_pfn_range_to_zone(struct zone *zone, unsigned long start_pfn,
> > > memmap_init_range(nr_pages, nid, zone_idx(zone), start_pfn, 0,
> > > MEMINIT_HOTPLUG, altmap, migratetype,
> > > isolate_pageblock);
> > > -
> > > - set_zone_contiguous(zone);
> > move_pfn_range_to_zone() is also called from memremap::pagemap_range().
> > Shouldn't we add set_zone_contiguous() there as well?
>
> I did not find the place where the online_pages was invoked along path of
> the memremap:pagemap_range() function. Would there be other functions to
> online the pages remapped? Much appreciated for the guidance.

Currently when we do memremap_pages() we have

memremap_pages() ->
pagemap_range() ->
move_pfn_range_to_zone() ->
set_zone_contiguous();

Once set_zone_contiguous() is moved out from move_pfn_range_to_zone(),
memremap_pages() path never calls it.
I'm not sure if the pages added in memremap_pages() are online, but to keep
it's current behaviour I think it should call set_zone_contiguous()
explicitly.

--
Sincerely yours,
Mike.