arch, mm: set high_memory in free_area_init()
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Thu, 13 Mar 2025 13:50:00 +0000 (15:50 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 18 Mar 2025 05:06:52 +0000 (22:06 -0700)
commite120d1bc12da5c1bb871c346f741296610fd6fcb
tree951d78b40fbfbb959adfbdf00e60b3cc2d37dacd
parent8268af309d07d1c6279080b4e6fd16ec75cc977c
arch, mm: set high_memory in free_area_init()

high_memory defines upper bound on the directly mapped memory.  This bound
is defined by the beginning of ZONE_HIGHMEM when a system has high memory
and by the end of memory otherwise.

All this is known to generic memory management initialization code that
can set high_memory while initializing core mm structures.

Add a generic calculation of high_memory to free_area_init() and remove
per-architecture calculation except for the architectures that set and use
high_memory earlier than that.

Link: https://lkml.kernel.org/r/20250313135003.836600-11-rppt@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com> [x86]
Tested-by: Mark Brown <broonie@kernel.org>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Borislav Betkov <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
Cc: Guo Ren (csky) <guoren@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Russel King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Thomas Gleinxer <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
25 files changed:
arch/alpha/mm/init.c
arch/arc/mm/init.c
arch/arm64/mm/init.c
arch/csky/mm/init.c
arch/hexagon/mm/init.c
arch/loongarch/kernel/numa.c
arch/loongarch/mm/init.c
arch/microblaze/mm/init.c
arch/mips/mm/init.c
arch/nios2/mm/init.c
arch/openrisc/mm/init.c
arch/parisc/mm/init.c
arch/riscv/mm/init.c
arch/s390/mm/init.c
arch/sh/mm/init.c
arch/sparc/mm/init_32.c
arch/sparc/mm/init_64.c
arch/um/kernel/um_arch.c
arch/x86/kernel/setup.c
arch/x86/mm/init_32.c
arch/x86/mm/numa_32.c
arch/xtensa/mm/init.c
mm/memory.c
mm/mm_init.c
mm/nommu.c