summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/mem.c
diff options
context:
space:
mode:
authorMike Kravetz2005-12-05 21:06:42 +0100
committerPaul Mackerras2006-01-09 04:51:57 +0100
commit237a0989e2902b7d43c4228a36d82f8691fb2118 (patch)
tree411b5e4978ac15ab283378610fef3941c880711a /arch/powerpc/mm/mem.c
parent[PATCH] powerpc: Separate usage of KERNELBASE and PAGE_OFFSET (diff)
downloadkernel-qcow2-linux-237a0989e2902b7d43c4228a36d82f8691fb2118.tar.gz
kernel-qcow2-linux-237a0989e2902b7d43c4228a36d82f8691fb2118.tar.xz
kernel-qcow2-linux-237a0989e2902b7d43c4228a36d82f8691fb2118.zip
[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>
Diffstat (limited to 'arch/powerpc/mm/mem.c')
-rw-r--r--arch/powerpc/mm/mem.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index ed6ed2e30dac..5e5bff5616a8 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -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);