Skip to content

Commit f3d815c

Browse files
Lans ZhangIngo Molnar
authored andcommitted
x86/mm/numa: Fix 32-bit kernel NUMA boot
When booting a 32-bit x86 kernel on a NUMA machine, node data cannot be allocated from local node if the account of memory for node 0 covers the low memory space entirely: [ 0.000000] Initmem setup node 0 [mem 0x00000000-0x83fffffff] [ 0.000000] NODE_DATA [mem 0x367ed000-0x367edfff] [ 0.000000] Initmem setup node 1 [mem 0x840000000-0xfffffffff] [ 0.000000] Cannot find 4096 bytes in node 1 [ 0.000000] 64664MB HIGHMEM available. [ 0.000000] 871MB LOWMEM available. To fix this issue, node data is allowed to be allocated from other nodes if the memory of local node is still not mapped. The expected result looks like this: [ 0.000000] Initmem setup node 0 [mem 0x00000000-0x83fffffff] [ 0.000000] NODE_DATA [mem 0x367ed000-0x367edfff] [ 0.000000] Initmem setup node 1 [mem 0x840000000-0xfffffffff] [ 0.000000] NODE_DATA [mem 0x367ec000-0x367ecfff] [ 0.000000] NODE_DATA(1) on node 0 [ 0.000000] 64664MB HIGHMEM available. [ 0.000000] 871MB LOWMEM available. Signed-off-by: Lans Zhang <jia.zhang@windriver.com> Cc: <andi@firstfloor.org> Cc: Yinghai Lu <yinghai@kernel.org> Link: http://lkml.kernel.org/r/1386303510-18574-1-git-send-email-jia.zhang@windriver.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 3331e92 commit f3d815c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

arch/x86/mm/numa.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,13 @@ static void __init setup_node_data(int nid, u64 start, u64 end)
211211
*/
212212
nd_pa = memblock_alloc_nid(nd_size, SMP_CACHE_BYTES, nid);
213213
if (!nd_pa) {
214-
pr_err("Cannot find %zu bytes in node %d\n",
215-
nd_size, nid);
216-
return;
214+
nd_pa = __memblock_alloc_base(nd_size, SMP_CACHE_BYTES,
215+
MEMBLOCK_ALLOC_ACCESSIBLE);
216+
if (!nd_pa) {
217+
pr_err("Cannot find %zu bytes in node %d\n",
218+
nd_size, nid);
219+
return;
220+
}
217221
}
218222
nd = __va(nd_pa);
219223

0 commit comments

Comments
 (0)