[PATCH] powerpc: numa placement for dynamically added memory

This places dynamically added memory within the appropriate
numa node.  A new routine hot_add_scn_to_nid() replicates most of
the memory scanning code in parse_numa_properties().

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Mike Kravetz
2005-12-05 12:06:42 -08:00
committed by Paul Mackerras
parent b5666f7039
commit 237a0989e2
3 changed files with 65 additions and 11 deletions

View File

@ -114,18 +114,17 @@ void online_page(struct page *page)
num_physpages++;
}
/*
* This works only for the non-NUMA case. Later, we'll need a lookup
* to convert from real physical addresses to nid, that doesn't use
* pfn_to_nid().
*/
int __devinit add_memory(u64 start, u64 size)
{
struct pglist_data *pgdata = NODE_DATA(0);
struct pglist_data *pgdata;
struct zone *zone;
int nid;
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
nid = hot_add_scn_to_nid(start);
pgdata = NODE_DATA(nid);
start += KERNELBASE;
create_section_mapping(start, start + size);