From: Mike Rapoport <rppt@kernel.org>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
David Hildenbrand <david@kernel.org>,
Taku Izumi <izumi.taku@jp.fujitsu.com>,
Yuan Liu <yuan1.liu@intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mm/mm_init: drop overlap_memmap_init()
Date: Fri, 26 Jun 2026 10:40:32 +0300 [thread overview]
Message-ID: <aj4s8DvCQ0jE2H_y@kernel.org> (raw)
In-Reply-To: <20260625095846.4e2tl3fbduc24erg@master>
Hi Wei,
On Thu, Jun 25, 2026 at 09:58:47AM +0000, Wei Yang wrote:
> On Thu, Jun 25, 2026 at 10:39:40AM +0300, Mike Rapoport wrote:
> >From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
> >
> >When ZONE_NORMAL and ZONE_MOVABLE could overlap because kernelcore=mirror
> >didn't reduce the span of ZONE_NORMAL, initialization of the memory map had
> >to skip overlapping pages during initialization of ZONE_MOVABLE to avoid
> >double initialization of the same struct pages.
> >
> >Since kernelcore=mirror works now the same way as other variants of
> >kernelcore=/movablecore=, and adjusts the span of ZONE_NORMAL, there can't
> >be an overlap between ZONE_NORMAL and ZONE_MOVABLE.
> >
> >Remove overlap_memmap_init().
> >
>
> Do you think this is valuable to mention the double init for the overlapped
> range?
Not sure I follow.
We had this weird overlap_memmap_init() exactly to avoid double init.
> >Co-developed-by: Wei Yang <richard.weiyang@gmail.com>
> >Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> >Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> >---
> > mm/mm_init.c | 24 ------------------------
> > 1 file changed, 24 deletions(-)
> >
> >diff --git a/mm/mm_init.c b/mm/mm_init.c
> >index dce9dc9f2302..6f0a71ccca30 100644
> >--- a/mm/mm_init.c
> >+++ b/mm/mm_init.c
> >@@ -783,28 +783,6 @@ void __meminit init_deferred_page(unsigned long pfn, int nid)
> > __init_deferred_page(pfn, nid);
> > }
> >
> >-/* If zone is ZONE_MOVABLE but memory is mirrored, it is an overlapped init */
> >-static bool __meminit
> >-overlap_memmap_init(unsigned long zone, unsigned long *pfn)
> >-{
> >- static struct memblock_region *r __meminitdata;
> >-
> >- if (mirrored_kernelcore && zone == ZONE_MOVABLE) {
> >- if (!r || *pfn >= memblock_region_memory_end_pfn(r)) {
> >- for_each_mem_region(r) {
> >- if (*pfn < memblock_region_memory_end_pfn(r))
> >- break;
> >- }
> >- }
> >- if (*pfn >= memblock_region_memory_base_pfn(r) &&
> >- memblock_is_mirror(r)) {
> >- *pfn = memblock_region_memory_end_pfn(r);
> >- return true;
> >- }
> >- }
> >- return false;
> >-}
> >-
> > /*
> > * Only struct pages that correspond to ranges defined by memblock.memory
> > * are zeroed and initialized by going through __init_single_page() during
> >@@ -891,8 +869,6 @@ void __meminit memmap_init_range(unsigned long size, int nid, unsigned long zone
> > * function. They do not exist on hotplugged memory.
> > */
> > if (context == MEMINIT_EARLY) {
> >- if (overlap_memmap_init(zone, &pfn))
> >- continue;
> > if (defer_init(nid, pfn, zone_end_pfn)) {
> > deferred_struct_pages = true;
> > break;
> >--
> >2.53.0
>
> --
> Wei Yang
> Help you, Help me
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2026-06-26 7:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 7:39 [PATCH 0/2] mm/mm_init: don't overlap zones with kernelcore=mirror Mike Rapoport
2026-06-25 7:39 ` [PATCH 1/2] mm/mm_init: don't overlap NORMAL and MOVABLE " Mike Rapoport
2026-06-25 10:42 ` David Hildenbrand (Arm)
2026-06-25 7:39 ` [PATCH 2/2] mm/mm_init: drop overlap_memmap_init() Mike Rapoport
2026-06-25 9:58 ` Wei Yang
2026-06-26 7:40 ` Mike Rapoport [this message]
2026-06-26 9:29 ` Wei Yang
2026-06-25 10:43 ` David Hildenbrand (Arm)
2026-06-26 8:11 ` [PATCH 0/2] mm/mm_init: don't overlap zones with kernelcore=mirror Mike Rapoport
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=aj4s8DvCQ0jE2H_y@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=david@kernel.org \
--cc=izumi.taku@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=richard.weiyang@gmail.com \
--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