sh: NUMA lmb fixes
This patch updates the NUMA version of setup_memory() with UMA code changes and also modifies the last argument to lmb_alloc_base() to use an address instead of pfn. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
@@ -37,6 +37,15 @@ void __init setup_memory(void)
|
|||||||
(PFN_PHYS(free_pfn) + PAGE_SIZE - 1) -
|
(PFN_PHYS(free_pfn) + PAGE_SIZE - 1) -
|
||||||
(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET));
|
(__MEMORY_START + CONFIG_ZERO_PAGE_OFFSET));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reserve physical pages below CONFIG_ZERO_PAGE_OFFSET.
|
||||||
|
*/
|
||||||
|
if (CONFIG_ZERO_PAGE_OFFSET != 0)
|
||||||
|
lmb_reserve(__MEMORY_START, CONFIG_ZERO_PAGE_OFFSET);
|
||||||
|
|
||||||
|
lmb_analyze();
|
||||||
|
lmb_dump_all();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Node 0 sets up its pgdat at the first available pfn,
|
* Node 0 sets up its pgdat at the first available pfn,
|
||||||
* and bumps it up before setting up the bootmem allocator.
|
* and bumps it up before setting up the bootmem allocator.
|
||||||
@@ -71,7 +80,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
|
|||||||
|
|
||||||
/* Node-local pgdat */
|
/* Node-local pgdat */
|
||||||
NODE_DATA(nid) = __va(lmb_alloc_base(sizeof(struct pglist_data),
|
NODE_DATA(nid) = __va(lmb_alloc_base(sizeof(struct pglist_data),
|
||||||
SMP_CACHE_BYTES, end_pfn));
|
SMP_CACHE_BYTES, end));
|
||||||
memset(NODE_DATA(nid), 0, sizeof(struct pglist_data));
|
memset(NODE_DATA(nid), 0, sizeof(struct pglist_data));
|
||||||
|
|
||||||
NODE_DATA(nid)->bdata = &bootmem_node_data[nid];
|
NODE_DATA(nid)->bdata = &bootmem_node_data[nid];
|
||||||
@@ -81,7 +90,7 @@ void __init setup_bootmem_node(int nid, unsigned long start, unsigned long end)
|
|||||||
/* Node-local bootmap */
|
/* Node-local bootmap */
|
||||||
bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
|
bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
|
||||||
bootmem_paddr = lmb_alloc_base(bootmap_pages << PAGE_SHIFT,
|
bootmem_paddr = lmb_alloc_base(bootmap_pages << PAGE_SHIFT,
|
||||||
PAGE_SIZE, end_pfn);
|
PAGE_SIZE, end);
|
||||||
init_bootmem_node(NODE_DATA(nid), bootmem_paddr >> PAGE_SHIFT,
|
init_bootmem_node(NODE_DATA(nid), bootmem_paddr >> PAGE_SHIFT,
|
||||||
start_pfn, end_pfn);
|
start_pfn, end_pfn);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user