[PATCH] mm: allocate section_map for sparse_init
allocate section_map in bootmem instead of using __initdata.
need to apply it after
[PATCH] mm: fix boundary checking in free_bootmem_core
[PATCH] mm: make mem_map allocation continuous.
Signed-off-by: Yinghai Lu <firstname.lastname@example.org>
free_bootmem will assume use bdata on NODE_DATA(0).
some cases: four nodes system: only have memory installed for node 1,
and node 3.
alloc_bootmem will loop to get bootmem from node1, because there is no
ram node0, and not NODE_DATA(0) ...
we may update free_bootmem to loop all bdata or all online nodes to
True. The unwritten assumption is that NODE_DATA(0) always has memory
Alternatively, update free_bootmem so that it figures out which node it is
meant to be freeing to based on the PFN of the page currently being freed.
It still doesn't seem right to try freeing on all online nodes as it looks like
free_bootmem_core() should flip bits outside the range of its node_bootmem_map
which could cause tricky bugs.
As things currently stand with bootmem, what you should be doing is using
for_each_online_node() to figure out which node you can allocate from,
remembering that node and calling free_bootmem_node() once. If you fix
free_bootmem() though, you should only need to call free_bootmem() once
in this patch.
Part-time Phd Student Linux Technology Center
University of Limerick IBM Dublin Software Lab