From: "Li, Tianyou" <tianyou.li@intel.com>
To: "David Hildenbrand (Red Hat)" <david@kernel.org>,
Oscar Salvador <osalvador@suse.de>,
Mike Rapoport <rppt@kernel.org>,
Wei Yang <richard.weiyang@gmail.com>
Cc: <linux-mm@kvack.org>, Yong Hu <yong.hu@intel.com>,
Nanhai Zou <nanhai.zou@intel.com>, Yuan Liu <yuan1.liu@intel.com>,
Tim Chen <tim.c.chen@linux.intel.com>,
Qiuxu Zhuo <qiuxu.zhuo@intel.com>,
Yu C Chen <yu.c.chen@intel.com>, Pan Deng <pan.deng@intel.com>,
Chen Zhang <zhangchen.kidd@jd.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v7 2/2] mm/memory hotplug/unplug: Optimize zone->contiguous update when changes pfn range
Date: Thu, 8 Jan 2026 16:31:05 +0800 [thread overview]
Message-ID: <6d2cda3f-7fe1-4436-9760-fde0622e88ad@intel.com> (raw)
In-Reply-To: <e5d0eb99-bd1d-4350-a6f5-367a870b2d5c@kernel.org>
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
next prev parent reply other threads:[~2026-01-08 8:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-22 14:58 [PATCH v7 0/2] Optimize zone->contiguous update and issue fix Tianyou Li
2025-12-22 14:58 ` [PATCH v7 1/2] mm/memory hotplug: fix zone->contiguous always false when hotplug Tianyou Li
2026-01-06 20:03 ` David Hildenbrand (Red Hat)
2026-01-08 7:35 ` Li, Tianyou
2025-12-22 14:58 ` [PATCH v7 2/2] mm/memory hotplug/unplug: Optimize zone->contiguous update when changes pfn range Tianyou Li
2026-01-06 20:18 ` David Hildenbrand (Red Hat)
2026-01-08 8:13 ` Li, Tianyou
2026-01-08 8:23 ` Li, Tianyou
2026-01-06 20:25 ` David Hildenbrand (Red Hat)
2026-01-08 8:31 ` Li, Tianyou [this message]
2026-01-05 12:21 ` [PATCH v7 0/2] Optimize zone->contiguous update and issue fix Li, Tianyou
2026-01-05 16:27 ` David Hildenbrand (Red Hat)
2026-01-06 3:48 ` Li, Tianyou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6d2cda3f-7fe1-4436-9760-fde0622e88ad@intel.com \
--to=tianyou.li@intel.com \
--cc=david@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nanhai.zou@intel.com \
--cc=osalvador@suse.de \
--cc=pan.deng@intel.com \
--cc=qiuxu.zhuo@intel.com \
--cc=richard.weiyang@gmail.com \
--cc=rppt@kernel.org \
--cc=tim.c.chen@linux.intel.com \
--cc=yong.hu@intel.com \
--cc=yu.c.chen@intel.com \
--cc=yuan1.liu@intel.com \
--cc=zhangchen.kidd@jd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox