diff options
author | Keith Mannthey <kmannth@us.ibm.com> | 2006-10-01 02:27:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-01 03:39:18 -0400 |
commit | 45e0b78b0532f92c01e363dd4287617c5be4574f (patch) | |
tree | 8c09edff4667535252b5c95efd68d397ae1283a5 /arch | |
parent | 53947027ad90542ddb2bb746e3175827c270610a (diff) |
[PATCH] hot-add-mem x86_64: use CONFIG_MEMORY_HOTPLUG_RESERVE
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')
-rw-r--r-- | arch/x86_64/mm/init.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index 71ecbb3f3262..19c72520a868 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c | |||
@@ -474,12 +474,12 @@ int arch_add_memory(int nid, u64 start, u64 size) | |||
474 | unsigned long nr_pages = size >> PAGE_SHIFT; | 474 | unsigned long nr_pages = size >> PAGE_SHIFT; |
475 | int ret; | 475 | int ret; |
476 | 476 | ||
477 | init_memory_mapping(start, (start + size -1)); | ||
478 | |||
477 | ret = __add_pages(zone, start_pfn, nr_pages); | 479 | ret = __add_pages(zone, start_pfn, nr_pages); |
478 | if (ret) | 480 | if (ret) |
479 | goto error; | 481 | goto error; |
480 | 482 | ||
481 | init_memory_mapping(start, (start + size -1)); | ||
482 | |||
483 | return ret; | 483 | return ret; |
484 | error: | 484 | error: |
485 | printk("%s: Problem encountered in __add_pages!\n", __func__); | 485 | printk("%s: Problem encountered in __add_pages!\n", __func__); |
@@ -501,7 +501,16 @@ int memory_add_physaddr_to_nid(u64 start) | |||
501 | EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); | 501 | EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); |
502 | #endif | 502 | #endif |
503 | 503 | ||
504 | #else /* CONFIG_MEMORY_HOTPLUG */ | 504 | #ifndef CONFIG_ACPI_NUMA |
505 | int memory_add_physaddr_to_nid(u64 start) | ||
506 | { | ||
507 | return 0; | ||
508 | } | ||
509 | #endif | ||
510 | |||
511 | #endif /* CONFIG_MEMORY_HOTPLUG */ | ||
512 | |||
513 | #ifdef CONFIG_MEMORY_HOTPLUG_RESERVE | ||
505 | /* | 514 | /* |
506 | * Memory Hotadd without sparsemem. The mem_maps have been allocated in advance, | 515 | * Memory Hotadd without sparsemem. The mem_maps have been allocated in advance, |
507 | * just online the pages. | 516 | * just online the pages. |
@@ -527,7 +536,7 @@ int __add_pages(struct zone *z, unsigned long start_pfn, unsigned long nr_pages) | |||
527 | } | 536 | } |
528 | return err; | 537 | return err; |
529 | } | 538 | } |
530 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 539 | #endif |
531 | 540 | ||
532 | static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, kcore_modules, | 541 | static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, kcore_modules, |
533 | kcore_vsyscall; | 542 | kcore_vsyscall; |