From nobody Sun Feb 8 11:26:12 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 779962F39B5; Sun, 11 Jan 2026 08:26:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768120001; cv=none; b=LdQwy4U0VDZJZAFUOm2dgvPGse24a1Oe2pjp3wRGLELNfqRpzSPfmgDRhuE3wQGdLUDTTAStTZCoinFRLPNqiKSIP03+xCzTtn8pK0TtMU5sD836AW/tV6iZJwvxLqT3f8SdR+wi5HOJsA7isKpfeVfaVc21XwnR2Mc8dRq3xRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768120001; c=relaxed/simple; bh=4MJzw8wq/vYacVlPos8SheQzjEj4nCDptI3YxDfhXAU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oZmeHeMR1d2IvkSA4N14TChX7jxAgdE8nhtqTMt7b11+OophrfhEyK4iECYnHhCM8AETphBD7GlsJqTNCS/7lkwIC07JxyHZd/JoxuqJByDo9sm+8SQ7jUf+ry6xLktqpD7hS0OmUQ/shUuPdjPQHtA8KKU8zdBbcMbawGuiRCI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nl3wHs1O; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nl3wHs1O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8F77C4CEF7; Sun, 11 Jan 2026 08:26:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768120001; bh=4MJzw8wq/vYacVlPos8SheQzjEj4nCDptI3YxDfhXAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nl3wHs1O2pqUdz0Vvuzmv46OR0qcJI1+HN5Ee4h/md2AnUo3Ou1FlhbxYHJnpXEFj Qdh5nldk6nj1FcSAWN1zgII2VIOLmZPirbF4ihWm3QG+z7kpMwkoSBVDrxhWWen7KB T2i3p8WFkV9Lgt6Z/5CoUlwWxBnIW/3tXd8oV8ehlBl8P22GRw/KKkaxcaBbDttGNB Gdbga/UDVtZTC0f9560H5GpOjK/dXA/5q43JwZkM44fdhedj3lwEfEjbC0p/+HAVxh Q6X399TIg7FsRwK7XllXsTWt217qXNEQIQr/VobGW+cbxfbUQn4O+kRXx6S2MViokM dlYMsjJ7vMB4A== From: Mike Rapoport To: Andrew Morton Cc: Alex Shi , Alexander Gordeev , Andreas Larsson , Borislav Petkov , Brian Cain , "Christophe Leroy (CS GROUP)" , Catalin Marinas , "David S. Miller" , Dave Hansen , David Hildenbrand , Dinh Nguyen , Geert Uytterhoeven , Guo Ren , Heiko Carstens , Helge Deller , Huacai Chen , Ingo Molnar , Johannes Berg , John Paul Adrian Glaubitz , Jonathan Corbet , Klara Modin , "Liam R. Howlett" , Lorenzo Stoakes , Magnus Lindholm , Matt Turner , Max Filippov , Michael Ellerman , Michal Hocko , Michal Simek , Mike Rapoport , Muchun Song , Oscar Salvador , Palmer Dabbelt , Pratyush Yadav , Richard Weinberger , Ritesh Harjani , Russell King , Stafford Horne , Suren Baghdasaryan , Thomas Bogendoerfer , Thomas Gleixner , Vasily Gorbik , Vineet Gupta , Vlastimil Babka , Will Deacon , x86@kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-cxl@vger.kernel.org, linux-doc@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org Subject: [PATCH v3 21/29] x86: introduce arch_zone_limits_init() Date: Sun, 11 Jan 2026 10:20:55 +0200 Message-ID: <20260111082105.290734-22-rppt@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260111082105.290734-1-rppt@kernel.org> References: <20260111082105.290734-1-rppt@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Mike Rapoport (Microsoft)" Move calculations of zone limits to a dedicated arch_zone_limits_init() function. Later MM core will use this function as an architecture specific callback during nodes and zones initialization and thus there won't be a need to call free_area_init() from every architecture. Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/mm/init.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 8bf6ad4b9400..e7ef605a18d6 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c @@ -997,12 +997,8 @@ void __init free_initrd_mem(unsigned long start, unsig= ned long end) } #endif =20 -void __init zone_sizes_init(void) +void __init arch_zone_limits_init(unsigned long *max_zone_pfns) { - unsigned long max_zone_pfns[MAX_NR_ZONES]; - - memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); - #ifdef CONFIG_ZONE_DMA max_zone_pfns[ZONE_DMA] =3D min(MAX_DMA_PFN, max_low_pfn); #endif @@ -1013,7 +1009,15 @@ void __init zone_sizes_init(void) #ifdef CONFIG_HIGHMEM max_zone_pfns[ZONE_HIGHMEM] =3D max_pfn; #endif +} + +void __init zone_sizes_init(void) +{ + unsigned long max_zone_pfns[MAX_NR_ZONES]; + + memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); =20 + arch_zone_limits_init(max_zone_pfns); free_area_init(max_zone_pfns); } =20 --=20 2.51.0