From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A54EE175A92 for ; Fri, 26 Jun 2026 07:40:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782459639; cv=none; b=rHW+CjUsGt7K5EaZiDZ67I03Nn7+KGk2DA9G+COfp1yWxJd1J1H8tqhuDsMv3sExAVJwiIKmO2DtlJlL7rpbTmKNEQ2KHj2xSbeN+ETjtQrdgK7o/bApE67QZr7Om0upFpPQ9D0UCs9sS2Mlj5XJAlJOi9QuLXMBUT9opiqqlys= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782459639; c=relaxed/simple; bh=2tq95fFGYAqNCqmcYNVzFEeSyu2CsYNpntZ25cSR5xs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iLOUUw0QCGSa14vbMjxApdhyKE9myHcfa+c0Gzn7+yhhauD7NsuBPixYp3tLXEKgOeBvxDHdTcCxLoCqmy3Hgo4dArsxr0g9Qnih9M18W0d6m9sJ4amsbI2hYeD2l06d1uDf3itooBo4RYspusm8Cmu7Mb+m2Aw20x2KQxcdNpg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T1ZMsLYo; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="T1ZMsLYo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50C5B1F000E9; Fri, 26 Jun 2026 07:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782459638; bh=Vh5mum4CE2iVLYNUmthPz0ghYxYQ9IfsJDxe2k3e6D4=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=T1ZMsLYoxOYdOSMC1j6XLXQrF7Koh+Ep+37Dhnig/mQNK73ByqK9b+hjxl0U0hFyA lK0DFjUZ63+L/1G9QE2v+z6Sa0Bl3pRpERY02mPEup5nczZV56aGjINoIr7opsMcRp gay4lEBm1gI9fHdTLsDWxaaAdxwLFnpdsz1RimoI6rt7ECUvlQMGNQfIlvg5dvL0NO feN7WpQC/WZTez6noyl6oFhkz1zivUJcfdQyZLKnE53PX8dQj+mKTOmL/LEDUGOHDh q9lNGJNkO840NMXj/8D2ZcinyRX1gcDx13ZbCjEuUtBTlNisJbNq0UFXNTO3Tf+5k4 xNX/hin5yVzNg== Date: Fri, 26 Jun 2026 10:40:32 +0300 From: Mike Rapoport To: Wei Yang Cc: linux-mm@kvack.org, Andrew Morton , David Hildenbrand , Taku Izumi , Yuan Liu , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] mm/mm_init: drop overlap_memmap_init() Message-ID: References: <20260625073941.145014-1-rppt@kernel.org> <20260625073941.145014-3-rppt@kernel.org> <20260625095846.4e2tl3fbduc24erg@master> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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)" > > > >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 > >Signed-off-by: Wei Yang > >Signed-off-by: Mike Rapoport (Microsoft) > >--- > > 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.