RE: [PATCH v4 0/2] mm/memory hotplug/unplug: Optimize zone contiguous check when changing pfn range
From: Liu, Yuan1
Date: Wed Apr 22 2026 - 23:18:15 EST
> -----Original Message-----
> From: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> Sent: Thursday, April 23, 2026 3:13 AM
> To: Liu, Yuan1 <yuan1.liu@xxxxxxxxx>; Oscar Salvador <osalvador@xxxxxxx>;
> Mike Rapoport <rppt@xxxxxxxxxx>; Wei Yang <richard.weiyang@xxxxxxxxx>
> Cc: linux-mm@xxxxxxxxx; Hu, Yong <yong.hu@xxxxxxxxx>; Zou, Nanhai
> <nanhai.zou@xxxxxxxxx>; Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>; Zhuo, Qiuxu
> <qiuxu.zhuo@xxxxxxxxx>; Chen, Yu C <yu.c.chen@xxxxxxxxx>; Deng, Pan
> <pan.deng@xxxxxxxxx>; Li, Tianyou <tianyou.li@xxxxxxxxx>; Chen Zhang
> <zhangchen.kidd@xxxxxx>; linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v4 0/2] mm/memory hotplug/unplug: Optimize zone
> contiguous check when changing pfn range
>
> On 4/22/26 09:56, Liu, Yuan1 wrote:
> >> -----Original Message-----
> >> From: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> >> Sent: Wednesday, April 22, 2026 3:47 PM
> >> To: Liu, Yuan1 <yuan1.liu@xxxxxxxxx>; Oscar Salvador
> <osalvador@xxxxxxx>;
> >> Mike Rapoport <rppt@xxxxxxxxxx>; Wei Yang <richard.weiyang@xxxxxxxxx>
> >> Cc: linux-mm@xxxxxxxxx; Hu, Yong <yong.hu@xxxxxxxxx>; Zou, Nanhai
> >> <nanhai.zou@xxxxxxxxx>; Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>; Zhuo,
> Qiuxu
> >> <qiuxu.zhuo@xxxxxxxxx>; Chen, Yu C <yu.c.chen@xxxxxxxxx>; Deng, Pan
> >> <pan.deng@xxxxxxxxx>; Li, Tianyou <tianyou.li@xxxxxxxxx>; Chen Zhang
> >> <zhangchen.kidd@xxxxxx>; linux-kernel@xxxxxxxxxxxxxxx
> >> Subject: Re: [PATCH v4 0/2] mm/memory hotplug/unplug: Optimize zone
> >> contiguous check when changing pfn range
> >>
> >> On 4/21/26 14:55, Yuan Liu wrote:
> >>> This series cleans up the overlap memory map init check and
> >>> optimizes zone contiguous check when changing pfn range.
> >>>
> >>> In addition to providing a significant improvement for VM hotplug
> >>> (see the second patch for reference), it brings benefits for CXL
> >>> hotplug as well. The link is as follows
> >>> https://lore.kernel.org/all/20260409023552.GA2807@AE/
> >>>
> >>> v3 link:
> >>> https://lore.kernel.org/all/20260408031615.1831922-1-
> >> yuan1.liu@xxxxxxxxx/
> >>>
> >>> v4 changes:
> >>> Add a new patch for clean up overlap memory map init check
> >>
> >> Didn't you also wanted to add a patch to improve shrink_zone_span to
> check
> >> both
> >> sides of the PAGES_PER_SUBSECTION block for fitting nid+zid?
> >
> > Hi David
> >
> > My apologies for missing this. I will include it in the next version.
>
> And isn't there also the problem with the subsection pfn_valid() handling
> etc
> where I proposed a change?
Hi David
Sorry I didn’t catch your earlier discussion with Wei Yang. I’ve found your
suggestion and implementation, and will split the pfn_valid/first_valid_pfn
changes into a separate patch for the next version.
For testing, I'll reproduce Wei Yang's setup (memblock_remove() of a
sub-section sized hole inside an early section) and confirm that
zone contiguous stays at 0, matching the behaviour before this series.
Thanks for the reminder, and thanks to Wei for the original report.
> --
> Cheers,
>
> David