aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory_hotplug.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r--mm/memory_hotplug.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index cc2ab37220b7..a650db29606f 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1107,17 +1107,18 @@ int __ref add_memory(int nid, u64 start, u64 size)
1107 if (ret) 1107 if (ret)
1108 return ret; 1108 return ret;
1109 1109
1110 lock_memory_hotplug();
1111
1112 res = register_memory_resource(start, size); 1110 res = register_memory_resource(start, size);
1113 ret = -EEXIST; 1111 ret = -EEXIST;
1114 if (!res) 1112 if (!res)
1115 goto out; 1113 return ret;
1116 1114
1117 { /* Stupid hack to suppress address-never-null warning */ 1115 { /* Stupid hack to suppress address-never-null warning */
1118 void *p = NODE_DATA(nid); 1116 void *p = NODE_DATA(nid);
1119 new_pgdat = !p; 1117 new_pgdat = !p;
1120 } 1118 }
1119
1120 lock_memory_hotplug();
1121
1121 new_node = !node_online(nid); 1122 new_node = !node_online(nid);
1122 if (new_node) { 1123 if (new_node) {
1123 pgdat = hotadd_new_pgdat(nid, start); 1124 pgdat = hotadd_new_pgdat(nid, start);
@@ -1309,7 +1310,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
1309#ifdef CONFIG_DEBUG_VM 1310#ifdef CONFIG_DEBUG_VM
1310 printk(KERN_ALERT "removing pfn %lx from LRU failed\n", 1311 printk(KERN_ALERT "removing pfn %lx from LRU failed\n",
1311 pfn); 1312 pfn);
1312 dump_page(page); 1313 dump_page(page, "failed to remove from LRU");
1313#endif 1314#endif
1314 put_page(page); 1315 put_page(page);
1315 /* Because we don't have big zone->lock. we should 1316 /* Because we don't have big zone->lock. we should