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

powerpc/mm: Use common paging_init() for NUMA

Commit 1c98025c6c95bc057a25e2c6596de23288c68160 "powerpc: Dynamic DMA
zone limits" updated how zones are created in paging_init(), but missed
the NUMA version of paging_init(). This was noticed via a linker
error, since dma_pfn_limit_to_zone() was, like the non-NUMA
paging_init(), limited by #ifndef CONFIG_NEED_MULTIPLE_NODES.

It turns out that the NUMA paging_init() was not actually doing
anything different from the standard paging_init(), other than a couple
debug prints, a couple 32-bit-only ifdef sections, and a call to
mark_nonram_nosave(). It's not clear whether mark_nonram_nosave() is
inherently wrong to do for NUMA, or just not useful on targets that
have NUMA, but for now I'm preserving the existing behavior.

Fixes: 1c98025c6c9 "powerpc: Dynamic DMA zone limits"
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Scott Wood <scottwood@freescale.com>

+6 -9
+6 -1
arch/powerpc/mm/mem.c
··· 259 259 } 260 260 return 0; 261 261 } 262 + #else /* CONFIG_NEED_MULTIPLE_NODES */ 263 + static int __init mark_nonram_nosave(void) 264 + { 265 + return 0; 266 + } 267 + #endif 262 268 263 269 static bool zone_limits_final; 264 270 ··· 357 351 358 352 mark_nonram_nosave(); 359 353 } 360 - #endif /* ! CONFIG_NEED_MULTIPLE_NODES */ 361 354 362 355 static void __init register_page_bootmem_info(void) 363 356 {
-8
arch/powerpc/mm/numa.c
··· 1126 1126 (void *)(unsigned long)boot_cpuid); 1127 1127 } 1128 1128 1129 - void __init paging_init(void) 1130 - { 1131 - unsigned long max_zone_pfns[MAX_NR_ZONES]; 1132 - memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); 1133 - max_zone_pfns[ZONE_DMA] = memblock_end_of_DRAM() >> PAGE_SHIFT; 1134 - free_area_init_nodes(max_zone_pfns); 1135 - } 1136 - 1137 1129 static int __init early_numa(char *p) 1138 1130 { 1139 1131 if (!p)