===================================================================
@@ -310,6 +310,9 @@ static int acpi_memory_remove_memory(str
{
int result;
struct acpi_memory_info *info, *n;
+ int node;
+
+ node = acpi_get_node(mem_device->device->handle);
list_for_each_entry_safe(info, n, &mem_device->res_list, list) {
if (!info->enabled)
@@ -319,6 +322,13 @@ static int acpi_memory_remove_memory(str
if (result)
return result;
+ if (node < 0)
+ node = memory_add_physaddr_to_nid(info->start_addr);
+
+ result = remove_memory(node, info->start_addr, info->length);
+ if (result)
+ return result;
+
list_del(&info->list);
kfree(info);
}
===================================================================
@@ -222,6 +222,7 @@ static inline void unlock_memory_hotplug
#ifdef CONFIG_MEMORY_HOTREMOVE
extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages);
+extern int remove_memory(int nid, u64 start, u64 size);
#else
static inline int is_mem_section_removable(unsigned long pfn,
@@ -229,6 +230,10 @@ static inline int is_mem_section_removab
{
return 0;
}
+static inline int remove_memory(int nid, u64 start, u64 size)
+{
+ return -EBUSY;
+}
#endif /* CONFIG_MEMORY_HOTREMOVE */
extern int mem_online_node(int nid);
===================================================================
@@ -1042,6 +1042,13 @@ int offline_memory(u64 start, u64 size)
return 0;
}
+
+int remove_memory(int nid, u64 start, u64 size)
+{
+ /* It is not implemented yet*/
+ return 0;
+}
+EXPORT_SYMBOL_GPL(remove_memory);
#else
int offline_pages(unsigned long start_pfn, unsigned long nr_pages)
{