From nobody Sun Feb 8 12:37:03 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 7B58B1A254E; Sun, 11 Jan 2026 08:22:09 +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=1768119729; cv=none; b=ItEOrhEsNJbYPfiIYjtz42a52jescRLSJD07ftsj6VIIPOMafR4IftnqH5nvXRK8vijaTwNL1akGc7XdTsw+5IYMYAZ4h2PXj1YLP1j3mlpwplNTOwOOXoL3rEfPHh3wwhQ3PQHwFa79C42MymSTc2wtv4XzJDiiaf/RblFiScE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768119729; c=relaxed/simple; bh=sY65/RaZssilanqAkKMZORd+RGdNjje1eX8P0rlpw6A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VUxAdWmDaaCyD9LKFgeHO2cNqND5d8m5dkms7kvyotlLHB3c5rSsxmslCfgcPxfEQaQdaUdth7a+1F5kk/cj3A788GX7+CESzIpBl6u0cH1vrS179lUoFtY6tOqXN6xA7yQ+OEpzu6zvJ0rrpGX/qxwg8kg1l6qqGZ/68rvO6uc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NN3lChfw; 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="NN3lChfw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A040C19423; Sun, 11 Jan 2026 08:21:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768119729; bh=sY65/RaZssilanqAkKMZORd+RGdNjje1eX8P0rlpw6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NN3lChfwg5P6LBJKzoLfcvbBwFyTjkbv176l7MWDDNEKfmQNsV9FdXu1iTB1p18r+ Qv6MGq+z4lJwgINv6l/GKUiPw4NesyjwjpepHwiPwzlDjiMWa+i1USjl07fz2MRYop Sc1LrWnu0Gc+BgNj4gzJRCHsWYSYmNHqJ3aaEPjVk5qnsYr4znc/0zqFTfi59zJAq/ ukCr7ZSzjxeYp7Kp6yUQVQxDk+q26sRhrXb+8OmAOZtQsY83a4N26iQ4g710XJtgiL iBzYFgAYbnZnLVEHpBAgxrkx8ozQkpwEdocd+bhVIEyIcdzpSjZYT6uJOIy5GXGxNb 0PvoDd12p4x0g== 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 03/29] arm: introduce arch_zone_limits_init() Date: Sun, 11 Jan 2026 10:20:37 +0200 Message-ID: <20260111082105.290734-4-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/arm/mm/init.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 54bdca025c9f..bdcc3639681f 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -107,18 +107,23 @@ void __init setup_dma_zone(const struct machine_desc = *mdesc) #endif } =20 -static void __init zone_sizes_init(unsigned long min, unsigned long max_lo= w, - unsigned long max_high) +void __init arch_zone_limits_init(unsigned long *max_zone_pfn) { - unsigned long max_zone_pfn[MAX_NR_ZONES] =3D { 0 }; - #ifdef CONFIG_ZONE_DMA - max_zone_pfn[ZONE_DMA] =3D min(arm_dma_pfn_limit, max_low); + max_zone_pfn[ZONE_DMA] =3D min(arm_dma_pfn_limit, max_low_pfn); #endif - max_zone_pfn[ZONE_NORMAL] =3D max_low; + max_zone_pfn[ZONE_NORMAL] =3D max_low_pfn; #ifdef CONFIG_HIGHMEM - max_zone_pfn[ZONE_HIGHMEM] =3D max_high; + max_zone_pfn[ZONE_HIGHMEM] =3D max_pfn; #endif +} + +static void __init zone_sizes_init(unsigned long min, unsigned long max_lo= w, + unsigned long max_high) +{ + unsigned long max_zone_pfn[MAX_NR_ZONES] =3D { 0 }; + + arch_zone_limits_init(max_zone_pfn); free_area_init(max_zone_pfn); } =20 --=20 2.51.0