[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6d2cda3f-7fe1-4436-9760-fde0622e88ad@intel.com>
Date: Thu, 8 Jan 2026 16:31:05 +0800
From: "Li, Tianyou" <tianyou.li@...el.com>
To: "David Hildenbrand (Red Hat)" <david@...nel.org>, Oscar Salvador
<osalvador@...e.de>, Mike Rapoport <rppt@...nel.org>, Wei Yang
<richard.weiyang@...il.com>
CC: <linux-mm@...ck.org>, Yong Hu <yong.hu@...el.com>, Nanhai Zou
<nanhai.zou@...el.com>, Yuan Liu <yuan1.liu@...el.com>, Tim Chen
<tim.c.chen@...ux.intel.com>, Qiuxu Zhuo <qiuxu.zhuo@...el.com>, Yu C Chen
<yu.c.chen@...el.com>, Pan Deng <pan.deng@...el.com>, Chen Zhang
<zhangchen.kidd@...com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v7 2/2] mm/memory hotplug/unplug: Optimize
zone->contiguous update when changes pfn range
On 1/7/2026 4:25 AM, David Hildenbrand (Red Hat) wrote:
>
> One more thing, the fact that the clear_zone_contiguous() happens in
> move_pfn_range_to_zone() is a bit suboptimal.
>
> Maybe we need a comment here like
>
> /*
> * Calculate the new zone contig state before move_pfn_range_to_zone()
> * sets the zone temporarily to non-contiguous.
> */
>
> Or something like that.
>
Will change accordingly. Thanks.
> Alternatively, we have to rework the code a bit that this dependency
> is a bit clearer.
Agreed, probably we can have this optimization first then explore a more
explicit approach for the zone contiguous state management.
>
>> + new_contiguous_state = zone_contig_state_after_growing(zone,
>> pfn, nr_pages);
>> /* associate pfn range with the zone */
>> move_pfn_range_to_zone(zone, pfn, nr_pages, NULL, MIGRATE_MOVABLE,
>> @@ -1204,7 +1273,7 @@ int online_pages(unsigned long pfn, unsigned
>> long nr_pages,
>> }
>> online_pages_range(pfn, nr_pages);
>> - set_zone_contiguous(zone);
>> + set_zone_contiguous(zone, new_contiguous_state);
>> adjust_present_page_count(pfn_to_page(pfn), group, nr_pages);
>
Regards,
Tianyou
Powered by blists - more mailing lists