RE: [PATCH v3] mm/memory hotplug/unplug: Optimize zone contiguous check when changing pfn range

Liu, Yuan1
2026-04-08T12:38:09Z

> -----Original Message-----
> From: David Hildenbrand (Arm) <david@kernel.org>
> Sent: Wednesday, April 8, 2026 8:31 PM
> To: Liu, Yuan1 <yuan1.liu@intel.com>; Oscar Salvador <osalvador@suse.de>;
> Mike Rapoport <rppt@kernel.org>; Wei Yang <richard.weiyang@gmail.com>
> Cc: linux-mm@kvack.org; Hu, Yong <yong.hu@intel.com>; Zou, Nanhai
> <nanhai.zou@intel.com>; Tim Chen <tim.c.chen@linux.intel.com>; Zhuo, Qiuxu
> <qiuxu.zhuo@intel.com>; Chen, Yu C <yu.c.chen@intel.com>; Deng, Pan
> <pan.deng@intel.com>; Li, Tianyou <tianyou.li@intel.com>; Chen Zhang
> <zhangchen.kidd@jd.com>; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v3] mm/memory hotplug/unplug: Optimize zone contiguous
> check when changing pfn range
>
>
> >>
> >> Maybe something like the following could make it nicer to read, just a
> >> thought.
> >>
> >> unsigned long hole_start_pfn = *hole_pfn;
> >>
> >> if (hole_start_pfn < zone_start_pfn) {
> >> init_unavailable_range(hole_start_pfn, zone_start_pfn,
> >> zone_id, nid);
> >> hole_start_pfn = zone_start_pfn;
> >> }
> >> pgcnt = init_unavailable_range(hole_start_pfn, start_pfn,
> >> zone_id, nid);
> >
> > Yes, this looks better. I'll apply your suggestion
>
> Best to wait for Mike's comments first! :)

Sure, I'll wait for Mike's comments before sending the next version.

> --
> Cheers,
>
> David