aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/mm/srat.c
diff options
context:
space:
mode:
authorKeith Mannthey <kmannth@us.ibm.com>2006-10-01 02:27:06 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:18 -0400
commit4942e998b40b8f6080930ec16442444e9930aee5 (patch)
tree7b321e7e632dddb88539dd2e22c3b4ad06fae4f2 /arch/x86_64/mm/srat.c
parent71efa8fdc55e70ec6687c897a30759f0a2c2ad7e (diff)
[PATCH] hot-add-mem x86_64: memory_add_physaddr_to_nid enable
The api for hot-add memory already has a construct for finding nodes based on an address, memory_add_physaddr_to_nid. This patch allows the fucntion to do something besides return 0. It uses the nodes_add infomation to lookup to node info for a hot add event. Signed-off-by: Keith Mannthey <kmannth@us.ibm.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Andi Kleen <ak@muc.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/mm/srat.c')
-rw-r--r--arch/x86_64/mm/srat.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c
index 19396a261e8d..8491300ef909 100644
--- a/arch/x86_64/mm/srat.c
+++ b/arch/x86_64/mm/srat.c
@@ -27,7 +27,7 @@ static struct acpi_table_slit *acpi_slit;
27 27
28static nodemask_t nodes_parsed __initdata; 28static nodemask_t nodes_parsed __initdata;
29static struct bootnode nodes[MAX_NUMNODES] __initdata; 29static struct bootnode nodes[MAX_NUMNODES] __initdata;
30static struct bootnode nodes_add[MAX_NUMNODES] __initdata; 30static struct bootnode nodes_add[MAX_NUMNODES];
31static int found_add_area __initdata; 31static int found_add_area __initdata;
32int hotadd_percent __initdata = 0; 32int hotadd_percent __initdata = 0;
33 33
@@ -466,3 +466,14 @@ int __node_distance(int a, int b)
466} 466}
467 467
468EXPORT_SYMBOL(__node_distance); 468EXPORT_SYMBOL(__node_distance);
469
470int memory_add_physaddr_to_nid(u64 start)
471{
472 int i, ret = 0;
473
474 for_each_node(i)
475 if (nodes_add[i].start <= start && nodes_add[i].end > start)
476 ret = i;
477
478 return ret;
479}