Commit aa235fc7 authored by Yinghai Lu's avatar Yinghai Lu Committed by H. Peter Anvin

bootmem, x86: Fix 32bit numa system without RAM on node 0

When 32bit numa is used, free_all_bootmem() will still only go over with
node id 0.

If node 0 doesn't have RAM installed, the lowest populated node
becomes low RAM.

This one fixes BOOTMEM path by iterating over the bdata_list.

-v3: add more comments, and fix bootmem path too.
-v4: seperate from one big patch
Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
LKML-Reference: <4BB416D7.6090203@kernel.org>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent 33799858
...@@ -312,7 +312,13 @@ unsigned long __init free_all_bootmem(void) ...@@ -312,7 +312,13 @@ unsigned long __init free_all_bootmem(void)
*/ */
return free_all_memory_core_early(MAX_NUMNODES); return free_all_memory_core_early(MAX_NUMNODES);
#else #else
return free_all_bootmem_core(NODE_DATA(0)->bdata); unsigned long total_pages = 0;
bootmem_data_t *bdata;
list_for_each_entry(bdata, &bdata_list, list)
total_pages += free_all_bootmem_core(bdata);
return total_pages;
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment