diff options
author | Yasunori Goto <y-goto@jp.fujitsu.com> | 2006-12-22 04:11:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-22 11:55:50 -0500 |
commit | 7c7e9425f114a109b07be2c2c1c6c169e34e9bb3 (patch) | |
tree | 9b530791da2e7683d80f779492347fff148d16b2 /arch | |
parent | 080dd51d81c8a9373303e9c344bbc75aacf54dce (diff) |
[PATCH] memory hotplug: fix compile error for i386 with NUMA config
Fix compile error when config memory hotplug with numa on i386.
The cause of compile error was missing of arch_add_memory(),
remove_memory(), and memory_add_physaddr_to_nid().
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Acked-by: David Rientjes <rientjes@cs.washington.edu>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/mm/discontig.c | 28 | ||||
-rw-r--r-- | arch/i386/mm/init.c | 10 |
2 files changed, 30 insertions, 8 deletions
diff --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c index 103b76e56a94..e0c390d6ceb5 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/i386/mm/discontig.c | |||
@@ -405,3 +405,31 @@ void __init set_highmem_pages_init(int bad_ppro) | |||
405 | totalram_pages += totalhigh_pages; | 405 | totalram_pages += totalhigh_pages; |
406 | #endif | 406 | #endif |
407 | } | 407 | } |
408 | |||
409 | #ifdef CONFIG_MEMORY_HOTPLUG | ||
410 | int paddr_to_nid(u64 addr) | ||
411 | { | ||
412 | int nid; | ||
413 | unsigned long pfn = PFN_DOWN(addr); | ||
414 | |||
415 | for_each_node(nid) | ||
416 | if (node_start_pfn[nid] <= pfn && | ||
417 | pfn < node_end_pfn[nid]) | ||
418 | return nid; | ||
419 | |||
420 | return -1; | ||
421 | } | ||
422 | |||
423 | /* | ||
424 | * This function is used to ask node id BEFORE memmap and mem_section's | ||
425 | * initialization (pfn_to_nid() can't be used yet). | ||
426 | * If _PXM is not defined on ACPI's DSDT, node id must be found by this. | ||
427 | */ | ||
428 | int memory_add_physaddr_to_nid(u64 addr) | ||
429 | { | ||
430 | int nid = paddr_to_nid(addr); | ||
431 | return (nid >= 0) ? nid : 0; | ||
432 | } | ||
433 | |||
434 | EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); | ||
435 | #endif | ||
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index 84697dfc7348..60a7e57af197 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c | |||
@@ -673,16 +673,10 @@ void __init mem_init(void) | |||
673 | #endif | 673 | #endif |
674 | } | 674 | } |
675 | 675 | ||
676 | /* | ||
677 | * this is for the non-NUMA, single node SMP system case. | ||
678 | * Specifically, in the case of x86, we will always add | ||
679 | * memory to the highmem for now. | ||
680 | */ | ||
681 | #ifdef CONFIG_MEMORY_HOTPLUG | 676 | #ifdef CONFIG_MEMORY_HOTPLUG |
682 | #ifndef CONFIG_NEED_MULTIPLE_NODES | ||
683 | int arch_add_memory(int nid, u64 start, u64 size) | 677 | int arch_add_memory(int nid, u64 start, u64 size) |
684 | { | 678 | { |
685 | struct pglist_data *pgdata = &contig_page_data; | 679 | struct pglist_data *pgdata = NODE_DATA(nid); |
686 | struct zone *zone = pgdata->node_zones + ZONE_HIGHMEM; | 680 | struct zone *zone = pgdata->node_zones + ZONE_HIGHMEM; |
687 | unsigned long start_pfn = start >> PAGE_SHIFT; | 681 | unsigned long start_pfn = start >> PAGE_SHIFT; |
688 | unsigned long nr_pages = size >> PAGE_SHIFT; | 682 | unsigned long nr_pages = size >> PAGE_SHIFT; |
@@ -694,7 +688,7 @@ int remove_memory(u64 start, u64 size) | |||
694 | { | 688 | { |
695 | return -EINVAL; | 689 | return -EINVAL; |
696 | } | 690 | } |
697 | #endif | 691 | EXPORT_SYMBOL_GPL(remove_memory); |
698 | #endif | 692 | #endif |
699 | 693 | ||
700 | struct kmem_cache *pgd_cache; | 694 | struct kmem_cache *pgd_cache; |