From: "David Hildenbrand (Red Hat)" <david@kernel.org>
To: "Li, Tianyou" <tianyou.li@intel.com>,
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: Wed, 14 Jan 2026 12:13:14 +0100 [thread overview]
Message-ID: <a7da047e-0064-4f21-9f8b-fa4bcf40dca3@kernel.org> (raw)
In-Reply-To: <e9d52093-d11e-4e0d-9bb9-88e0ffb78a19@intel.com>
>>
>> This is nasty. I would wish we could just leave that code path alone.
>>
>> In particular: I am 99% sure that we never ever run into this case in
>> practice.
>>
>> E.g., on x86, we can have up to 2 GiB memory blocks. But the memmap of
>> that is 64/4096*2GiB == 32 MB ... and a memory section is 128 MiB.
>>
>>
>> As commented on patch #1, we should drop the set_zone_contiguous() in
>> this function either way and let online_pages() deal with it.
>>
>> We just have to make sure that we don't create some inconsistencies by
>> doing that.
>>
>> Can you double-check?
I thought about this some more, and it's all a bit nasty. We have to get this right.
Losing the optimization for memmap_on_memory users indicates that we are doing the wrong thing.
You could introduce the set_zone_contiguous() in this patch here. But then, I think instead of
+ /*
+ * If the allocated memmap pages are not in a full section, keep the
+ * contiguous state as ZONE_CONTIG_NO.
+ */
+ if (IS_ALIGNED(end_pfn, PAGES_PER_SECTION))
+ new_contiguous_state = zone_contig_state_after_growing(zone,
+ pfn, nr_pages);
+
We'd actually unconditionally have to do that, no?
--
Cheers
David
next prev parent reply other threads:[~2026-01-14 11:13 UTC|newest]
Thread overview: 14+ 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-14 11:13 ` David Hildenbrand (Red Hat) [this message]
2026-01-06 20:25 ` David Hildenbrand (Red Hat)
2026-01-08 8:31 ` Li, Tianyou
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=a7da047e-0064-4f21-9f8b-fa4bcf40dca3@kernel.org \
--to=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=tianyou.li@intel.com \
--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