Commit 4e272fed authored by Anton Blanchard's avatar Anton Blanchard

ppc64: Fix for empty memory nodes when NUMA is enabled

parent b3a2becf
......@@ -306,6 +306,7 @@ void __init paging_init(void)
{
unsigned long zones_size[MAX_NR_ZONES];
int i, nid;
struct page *node_mem_map;
for (i = 1; i < MAX_NR_ZONES; i++)
zones_size[i] = 0;
......@@ -314,16 +315,24 @@ void __init paging_init(void)
unsigned long start_pfn;
unsigned long end_pfn;
if (node_data[nid].node_spanned_pages == 0)
continue;
start_pfn = plat_node_bdata[nid].node_boot_start >> PAGE_SHIFT;
end_pfn = plat_node_bdata[nid].node_low_pfn;
zones_size[ZONE_DMA] = end_pfn - start_pfn;
dbg("free_area_init node %d %lx %lx\n", nid,
zones_size[ZONE_DMA], start_pfn);
free_area_init_node(nid, NODE_DATA(nid), NULL, zones_size,
start_pfn, NULL);
/*
* Give this empty node a dummy struct page to avoid
* us from trying to allocate a node local mem_map
* in free_area_init_node (which will fail).
*/
if (!node_data[nid].node_spanned_pages)
node_mem_map = alloc_bootmem(sizeof(struct page));
else
node_mem_map = NULL;
free_area_init_node(nid, NODE_DATA(nid), node_mem_map,
zones_size, start_pfn, NULL);
}
}
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