From: Wei Yang <richard.weiyang@gmail.com>
To: Mike Rapoport <rppt@kernel.org>
Cc: Wei Yang <richard.weiyang@gmail.com>,
akpm@linux-foundation.org, izumi.taku@jp.fujitsu.com,
linux-mm@kvack.org, Yuan Liu <yuan1.liu@intel.com>,
David Hildenbrand <david@kernel.org>
Subject: Re: [PATCH] mm/mm_init: fix incorrect node_spanned_pages
Date: Tue, 23 Jun 2026 09:26:53 +0000 [thread overview]
Message-ID: <20260623092653.yfahsc7kekuncbcf@master> (raw)
In-Reply-To: <ajpQR0hX681OryCB@kernel.org>
On Tue, Jun 23, 2026 at 12:22:15PM +0300, Mike Rapoport wrote:
>Hi Wei,
>
>On Tue, Jun 23, 2026 at 08:35:07AM +0000, Wei Yang wrote:
>> On Mon, Jun 22, 2026 at 04:58:47PM +0300, Mike Rapoport wrote:
>> >On Mon, Jun 22, 2026 at 02:24:03AM +0000, Wei Yang wrote:
>> >> Current node_spanned_pages is got as a summation of all zone's spanned page
>> >> in calculate_node_totalpages(). Generally this is good, but if we use
>> >> kernelcore=mirror, it is would be wrong.
>> >>
>> >> As we already passed in node_start_pfn and node_end_pfn, fix this by get it
>> >> from (node_start_pfn - node_end_pfn) directly.
>> >>
>> >> Fixes: 342332e6a925 ("mm/page_alloc.c: introduce kernelcore=mirror option")
>> >> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> >> Cc: Yuan Liu <yuan1.liu@intel.com>
>> >
>> >I queued it for now, will push to one of memblock branches after merge
>> >window closes.
>> >
>>
>> After some investigation, I found current mirrored_kernelcore may still affect
>> memmap_init() in some aspects.
>>
>> But how to fix is not sure, will prepare an RFC for discussion.
>
>After I applied your patch, I did some checks to see why
>mirrored_kernelcore causes us troubles. I found that unlike other variants
>of kernelcore/movablecore settings, mirrored_kernelcore creates zone
>overlap for no apparent reason. I did some git archaeology and I didn't
>find a justification for making overlapping pages absent in ZONE_NORMAL.
>
>So I came up with this cleanup:
>
>https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/log/?h=kernelcore-mirror
>
>I'm waiting for the bots to chew on it before positing the patches.
>
Ah, just the same as I do :-).
>> --
>> Wei Yang
>> Help you, Help me
>
>--
>Sincerely yours,
>Mike.
--
Wei Yang
Help you, Help me
prev parent reply other threads:[~2026-06-23 9:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 2:24 [PATCH] mm/mm_init: fix incorrect node_spanned_pages Wei Yang
2026-06-22 13:58 ` Mike Rapoport
2026-06-23 8:35 ` Wei Yang
2026-06-23 9:22 ` Mike Rapoport
2026-06-23 9:26 ` Wei Yang [this message]
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=20260623092653.yfahsc7kekuncbcf@master \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=izumi.taku@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=rppt@kernel.org \
--cc=yuan1.liu@intel.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