The patch titled Fix compile error of memory hotplug has been removed from the -mm tree. Its filename is pgdat-allocation-for-new-node-add-specify-node-id-build-fixes.patch This patch was probably dropped from -mm because it has now been merged into a subsystem tree or into Linus's tree, or because it was folded into its parent patch in the -mm tree. ------------------------------------------------------ Subject: Fix compile error of memory hotplug From: Yasunori Goto <y-goto@xxxxxxxxxxxxxx> - x86_64 is required memory hotplug even if CONFIG_MEMORY_HOTPLUG is off. But, its #ifdef looks broken. I changed #ifdef by using CONFIG_MEMORY_HOTPLUG. - memory_add_physaddr_to_nid() It was not defined for x86-64. Fix silly typo in include/linux/memory_hotplug.h It is just for NUMA. So, I add #ifdef for powerpc. - export symbol for add_memory of mm/memory_hotplug.c driver/acpi/acpi_memhotplug.c can be module. add_memory() is called by it. Signed-off-by: Yasunori Goto <y-goto@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- arch/powerpc/mm/mem.c | 2 + arch/x86_64/mm/init.c | 60 ++++++++++++++++++------------- include/linux/memory_hotplug.h | 2 - mm/memory_hotplug.c | 1 4 files changed, 39 insertions(+), 26 deletions(-) diff -puN arch/powerpc/mm/mem.c~pgdat-allocation-for-new-node-add-specify-node-id-build-fixes arch/powerpc/mm/mem.c --- devel/arch/powerpc/mm/mem.c~pgdat-allocation-for-new-node-add-specify-node-id-build-fixes 2006-04-29 23:37:16.000000000 -0700 +++ devel-akpm/arch/powerpc/mm/mem.c 2006-04-29 23:37:16.000000000 -0700 @@ -114,10 +114,12 @@ void online_page(struct page *page) num_physpages++; } +#ifdef CONFIG_NUMA int memory_add_physaddr_to_nid(u64 start) { return hot_add_scn_to_nid(start); } +#endif int __devinit arch_add_memory(int nid, u64 start, u64 size) { diff -puN arch/x86_64/mm/init.c~pgdat-allocation-for-new-node-add-specify-node-id-build-fixes arch/x86_64/mm/init.c --- devel/arch/x86_64/mm/init.c~pgdat-allocation-for-new-node-add-specify-node-id-build-fixes 2006-04-29 23:37:16.000000000 -0700 +++ devel-akpm/arch/x86_64/mm/init.c 2006-04-29 23:37:16.000000000 -0700 @@ -508,8 +508,6 @@ void __init clear_kernel_mapping(unsigne /* * Memory hotplug specific functions */ -#if defined(CONFIG_ACPI_HOTPLUG_MEMORY) || defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE) - void online_page(struct page *page) { ClearPageReserved(page); @@ -519,31 +517,17 @@ void online_page(struct page *page) num_physpages++; } -#ifndef CONFIG_MEMORY_HOTPLUG +#ifdef CONFIG_MEMORY_HOTPLUG /* - * Memory Hotadd without sparsemem. The mem_maps have been allocated in advance, - * just online the pages. + * XXX: memory_add_physaddr_to_nid() is to find node id from physical address + * via probe interface of sysfs. If acpi notifies hot-add event, then it + * can tell node id by searching dsdt. But, probe interface doesn't have + * node id. So, return 0 as node id at this time. */ -int __add_pages(struct zone *z, unsigned long start_pfn, unsigned long nr_pages) +#ifdef CONFIG_NUMA +int memory_add_physaddr_to_nid(u64 start) { - int err = -EIO; - unsigned long pfn; - unsigned long total = 0, mem = 0; - for (pfn = start_pfn; pfn < start_pfn + nr_pages; pfn++) { - if (pfn_valid(pfn)) { - online_page(pfn_to_page(pfn)); - err = 0; - mem++; - } - total++; - } - if (!err) { - z->spanned_pages += total; - z->present_pages += mem; - z->zone_pgdat->node_spanned_pages += total; - z->zone_pgdat->node_present_pages += mem; - } - return err; + return 0; } #endif @@ -578,7 +562,33 @@ int remove_memory(u64 start, u64 size) } EXPORT_SYMBOL_GPL(remove_memory); -#endif +#else /* CONFIG_MEMORY_HOTPLUG */ +/* + * Memory Hotadd without sparsemem. The mem_maps have been allocated in advance, + * just online the pages. + */ +int __add_pages(struct zone *z, unsigned long start_pfn, unsigned long nr_pages) +{ + int err = -EIO; + unsigned long pfn; + unsigned long total = 0, mem = 0; + for (pfn = start_pfn; pfn < start_pfn + nr_pages; pfn++) { + if (pfn_valid(pfn)) { + online_page(pfn_to_page(pfn)); + err = 0; + mem++; + } + total++; + } + if (!err) { + z->spanned_pages += total; + z->present_pages += mem; + z->zone_pgdat->node_spanned_pages += total; + z->zone_pgdat->node_present_pages += mem; + } + return err; +} +#endif /* CONFIG_MEMORY_HOTPLUG */ static struct kcore_list kcore_mem, kcore_vmalloc, kcore_kernel, kcore_modules, kcore_vsyscall; diff -puN include/linux/memory_hotplug.h~pgdat-allocation-for-new-node-add-specify-node-id-build-fixes include/linux/memory_hotplug.h --- devel/include/linux/memory_hotplug.h~pgdat-allocation-for-new-node-add-specify-node-id-build-fixes 2006-04-29 23:37:16.000000000 -0700 +++ devel-akpm/include/linux/memory_hotplug.h 2006-04-29 23:37:21.000000000 -0700 @@ -67,7 +67,7 @@ extern int __add_pages(struct zone *zone #ifdef CONFIG_NUMA extern int memory_add_physaddr_to_nid(u64 start); #else -static inline int memofy_add_physaddr_to_nid(u64 start) +static inline int memory_add_physaddr_to_nid(u64 start) { return 0; } diff -puN mm/memory_hotplug.c~pgdat-allocation-for-new-node-add-specify-node-id-build-fixes mm/memory_hotplug.c --- devel/mm/memory_hotplug.c~pgdat-allocation-for-new-node-add-specify-node-id-build-fixes 2006-04-29 23:37:16.000000000 -0700 +++ devel-akpm/mm/memory_hotplug.c 2006-04-29 23:37:21.000000000 -0700 @@ -173,3 +173,4 @@ int add_memory(int nid, u64 start, u64 s return ret; } +EXPORT_SYMBOL_GPL(add_memory); _ Patches currently in -mm which might be from y-goto@xxxxxxxxxxxxxx are spanned_pages-is-not-updated-at-a-case-of-memory-hot-add.patch catch-notification-of-memory-add-event-of-acpi-via-container-driver-register-start-func-for-memory-device.patch catch-notification-of-memory-add-event-of-acpi-via-container-driveravoid-redundant-call-add_memory.patch wait_table-and-zonelist-initializing-for-memory-hotadd-change-name-of-wait_table_size.patch wait_table-and-zonelist-initializing-for-memory-hotadd-change-to-meminit-for-build_zonelist.patch wait_table-and-zonelist-initializing-for-memory-hotaddadd-return-code-for-init_current_empty_zone.patch wait_table-and-zonelist-initializing-for-memory-hotadd-wait_table-initialization.patch wait_table-and-zonelist-initializing-for-memory-hotadd-update-zonelists.patch unify-pxm_to_node-and-node_to_pxm.patch pgdat-allocation-for-new-node-add-specify-node-id.patch pgdat-allocation-for-new-node-add-get-node-id-by-acpi.patch pgdat-allocation-for-new-node-add-generic-alloc-node_data.patch pgdat-allocation-for-new-node-add-refresh-node_data.patch pgdat-allocation-for-new-node-add-export-kswapd-start-func.patch pgdat-allocation-for-new-node-add-call-pgdat-allocation.patch fix-compile-error-undefined-reference-for-sparc64.patch register-sysfs-file-for-hotpluged-new-node.patch pgdat-allocation-and-update-for-ia64-of-memory-hotplughold-pgdat-address-at-system-running.patch pgdat-allocation-and-update-for-ia64-of-memory-hotplug-update-pgdat-address-array.patch pgdat-allocation-and-update-for-ia64-of-memory-hotplugallocate-pgdat-and-per-node-data.patch sparsemem-record-nid-during-memory-present.patch node-hotplug-register-cpu-remove-node-struct.patch node-hotplug-fixes-callres-of-register_cpu.patch node-hotplug-register_node-fix.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html