From 78988ff4fd8b120d9fe5da861556f5233af8cf3c Mon Sep 17 00:00:00 2001 From: Keith Mannthey Date: Sat, 30 Sep 2006 23:27:07 -0700 Subject: [PATCH] --- yaml --- r: 37605 b: refs/heads/master c: 8c2676a5870ab15cbeea9f826266bc946fe3cc26 h: refs/heads/master i: 37603: 1fcc08cb38c717a1caa4818e41356754eebcdf7f v: v3 --- [refs] | 2 +- trunk/arch/ia64/mm/numa.c | 18 ++++++++++++++++++ trunk/arch/x86_64/mm/init.c | 1 + trunk/arch/x86_64/mm/srat.c | 2 ++ trunk/drivers/acpi/acpi_memhotplug.c | 4 ++++ 5 files changed, 26 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 04b95c96f977..a046f8e2337b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4942e998b40b8f6080930ec16442444e9930aee5 +refs/heads/master: 8c2676a5870ab15cbeea9f826266bc946fe3cc26 diff --git a/trunk/arch/ia64/mm/numa.c b/trunk/arch/ia64/mm/numa.c index 64e4c21f311c..7807fc5c0422 100644 --- a/trunk/arch/ia64/mm/numa.c +++ b/trunk/arch/ia64/mm/numa.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -69,4 +70,21 @@ int early_pfn_to_nid(unsigned long pfn) return 0; } + +#ifdef CONFIG_MEMORY_HOTPLUG +/* + * SRAT information is stored in node_memblk[], then we can use SRAT + * information at memory-hot-add if necessary. + */ + +int memory_add_physaddr_to_nid(u64 addr) +{ + int nid = paddr_to_nid(addr); + if (nid < 0) + return 0; + return nid; +} + +EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); +#endif #endif diff --git a/trunk/arch/x86_64/mm/init.c b/trunk/arch/x86_64/mm/init.c index e759109abb36..71ecbb3f3262 100644 --- a/trunk/arch/x86_64/mm/init.c +++ b/trunk/arch/x86_64/mm/init.c @@ -498,6 +498,7 @@ int memory_add_physaddr_to_nid(u64 start) { return 0; } +EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); #endif #else /* CONFIG_MEMORY_HOTPLUG */ diff --git a/trunk/arch/x86_64/mm/srat.c b/trunk/arch/x86_64/mm/srat.c index 8491300ef909..3cc0544e25f5 100644 --- a/trunk/arch/x86_64/mm/srat.c +++ b/trunk/arch/x86_64/mm/srat.c @@ -477,3 +477,5 @@ int memory_add_physaddr_to_nid(u64 start) return ret; } +EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); + diff --git a/trunk/drivers/acpi/acpi_memhotplug.c b/trunk/drivers/acpi/acpi_memhotplug.c index 1dda370f402b..98099de59b45 100644 --- a/trunk/drivers/acpi/acpi_memhotplug.c +++ b/trunk/drivers/acpi/acpi_memhotplug.c @@ -238,6 +238,10 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device) num_enabled++; continue; } + + if (node < 0) + node = memory_add_physaddr_to_nid(info->start_addr); + result = add_memory(node, info->start_addr, info->length); if (result) continue;