Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mips: introduce arch_zone_limits_init()

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.

Link: https://lkml.kernel.org/r/20260111082105.290734-12-rppt@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alex Shi <alexs@kernel.org>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Dinh Nguyen <dinguyen@kernel.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Guo Ren <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: Johannes Berg <johannes@sipsolutions.net>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Klara Modin <klarasmodin@gmail.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Magnus Lindholm <linmag7@gmail.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Pratyush Yadav <pratyush@kernel.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Mike Rapoport (Microsoft) and committed by
Andrew Morton
f61385e2 2ce38c9a

+22 -8
+7 -2
arch/mips/loongson64/numa.c
··· 154 154 } 155 155 } 156 156 157 + void __init arch_zone_limits_init(unsigned long *max_zone_pfns) 158 + { 159 + max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN; 160 + max_zone_pfns[ZONE_NORMAL] = max_low_pfn; 161 + } 162 + 157 163 void __init paging_init(void) 158 164 { 159 165 unsigned long zones_size[MAX_NR_ZONES] = {0, }; 160 166 161 167 pagetable_init(); 162 - zones_size[ZONE_DMA32] = MAX_DMA32_PFN; 163 - zones_size[ZONE_NORMAL] = max_low_pfn; 168 + arch_zone_limits_init(zones_size); 164 169 free_area_init(zones_size); 165 170 } 166 171
+9 -5
arch/mips/mm/init.c
··· 394 394 } 395 395 396 396 #ifndef CONFIG_NUMA 397 - void __init paging_init(void) 397 + void __init arch_zone_limits_init(unsigned long *max_zone_pfns) 398 398 { 399 - unsigned long max_zone_pfns[MAX_NR_ZONES]; 400 - 401 - pagetable_init(); 402 - 403 399 #ifdef CONFIG_ZONE_DMA 404 400 max_zone_pfns[ZONE_DMA] = MAX_DMA_PFN; 405 401 #endif ··· 413 417 max_zone_pfns[ZONE_HIGHMEM] = max_low_pfn; 414 418 } 415 419 #endif 420 + } 416 421 422 + void __init paging_init(void) 423 + { 424 + unsigned long max_zone_pfns[MAX_NR_ZONES]; 425 + 426 + pagetable_init(); 427 + 428 + arch_zone_limits_init(max_zone_pfns); 417 429 free_area_init(max_zone_pfns); 418 430 } 419 431
+6 -1
arch/mips/sgi-ip27/ip27-memory.c
··· 406 406 } 407 407 } 408 408 409 + void __init arch_zone_limits_init(unsigned long *max_zone_pfns) 410 + { 411 + max_zone_pfns[ZONE_NORMAL] = max_low_pfn; 412 + } 413 + 409 414 void __init paging_init(void) 410 415 { 411 416 unsigned long zones_size[MAX_NR_ZONES] = {0, }; 412 417 413 418 pagetable_init(); 414 - zones_size[ZONE_NORMAL] = max_low_pfn; 419 + arch_zone_limits_init(zones_size); 415 420 free_area_init(zones_size); 416 421 }