memory hotplug function redefinition/confusion
2.6.19-rc5-mm2:
include/linux/memory_hotplug.h uses CONFIG_NUMA to decide:
#ifdef CONFIG_NUMA
extern int memory_add_physaddr_to_nid(u64 start); #else
static inline int memory_add_physaddr_to_nid(u64 start)
{
return 0;
}#endif
but mm/init.c uses CONFIG_ACPI_NUMA to decide:
#ifndef CONFIG_ACPI_NUMA
int memory_add_physaddr_to_nid(u64 start)
{
return 0;
}EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
#endif
#ifndef CONFIG_ACPI_NUMA
int memory_add_physaddr_to_nid(u64 start)
{
return 0;
}#endif
(sic: duplicate function above)
The CONFIG_NUMA vs. CONFIG_ACPI_NUMA seems to cause this build error:
CC arch/x86_64/mm/init.oarch/x86_64/mm/init.c:501: error: redefinition of 'memory_add_physaddr_to_nid' include/linux/memory_hotplug.h:71: error: previous definition of 'memory_add_phys addr_to_nid' was herearch/x86_64/mm/init.c:509: error: redefinition of 'memory_add_physaddr_to_nid' arch/x86_64/mm/init.c:501: error: previous definition of 'memory_add_physaddr_to_ nid' was here
make[1]: *** [arch/x86_64/mm/init.o] Error 1
make: *** [arch/x86_64/mm] Error 2
---
~Randy
Quoted 35 lines · On Thu, 16 Nov 2006 20:25:20 -0800 Randy Dunlap wrote:
2.6.19-rc5-mm2:
include/linux/memory_hotplug.husesCONFIG_NUMAto decide:#ifdef
CONFIG_NUMA
extern intmemory_add_physaddr_to_nid(u64 start); #else
static inline intmemory_add_physaddr_to_nid(u64 start){ return 0; }#endif
but
mm/init.cusesCONFIG_ACPI_NUMAto decide:#ifndef
CONFIG_ACPI_NUMA
intmemory_add_physaddr_to_nid(u64 start){ return 0; }
EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
#endif#ifndef
CONFIG_ACPI_NUMA
intmemory_add_physaddr_to_nid(u64 start){ return 0; }#endif
(sic: duplicate function above)
The
CONFIG_NUMAvs.CONFIG_ACPI_NUMAseems to cause this build error:
Quoted 9 lines
CC
arch/x86_64/mm/init.oarch/x86_64/mm/init.c:501: error: redefinition of 'memory_add_physaddr_to_nid'include/linux/memory_hotplug.h:71: error: previous definition of 'memory_add_physaddr_to_nid' was herearch/x86_64/mm/init.c:509: error: redefinition of 'memory_add_physaddr_to_nid'arch/x86_64/mm/init.c:501: error: previous definition of 'memory_add_physaddr_to_nid' was here
make[1]: *** [arch/x86_64/mm/init.o] Error 1
make: *** [arch/x86_64/mm] Error 2
Actually no flavor of NUMA is set:
http://oss.oracle.com/~rdunlap/configs/config-numa-err
---
~Randy
Hello.
Quoted 1 line
include/linux/memory_hotplug.husesCONFIG_NUMAto decide:
(snip)
Quoted 1 line
but
mm/init.cusesCONFIG_ACPI_NUMAto decide:
(snip)
Quoted 1 line
(sic: duplicate function above)
Indeed. It is strange. This is a patch for it.
Thanks for your report!
Bye.
--------
This is to fix compile error of x86-64 memory hotplug without any NUMA option.
CC arch/x86_64/mm/init.oarch/x86_64/mm/init.c:501: error: redefinition of 'memory_add_physaddr_to_nid' include/linux/memory_hotplug.h:71: error: previous definition of 'memory_add_phys addr_to_nid' was herearch/x86_64/mm/init.c:509: error: redefinition of 'memory_add_physaddr_to_nid' arch/x86_64/mm/init.c:501: error: previous definition of 'memory_add_physaddr_to_ nid' was here
make[1]: *** [arch/x86_64/mm/init.o] Error 1
I confirmed compile completion with !NUMA, (NUMA & !ACPI_NUMA), or (NUMA & ACPI_NUMA).
This patch is for 2.6.19-rc5-mm2.
----
arch/x86_64/mm/init.c | 9 +-------- 1 files changed, 1 insertion(+), 8 deletions(-)
arch/x86_64/mm/init.c +1 -8
@@ -496,7 +496,7 @@ int remove_memory(u64 start, u64 size) }EXPORT_SYMBOL_GPL (remove_memory); -#ifndef CONFIG_ACPI_NUMA +#if !defined(CONFIG_ACPI_NUMA ) && defined(CONFIG_NUMA )int memory_add_physaddr_to_nid (u64 start) {return 0 ;
@@ -504,13 +504,6 @@ int memory_add_physaddr_to_nid(u64 startEXPORT_SYMBOL_GPL (memory_add_physaddr_to_nid);#endif -#ifndef CONFIG_ACPI_NUMA -int memory_add_physaddr_to_nid (u64 start) -{ -return 0 ; -} -#endif -#endif /* CONFIG_MEMORY_HOTPLUG */ #ifdef CONFIG_MEMORY_HOTPLUG_RESERVE
Signature · 1 line
Yasunori Goto