aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory_hotplug.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-05-14 19:05:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-14 22:11:14 -0400
commitc3723ca3874a8fc2218c4726d57e3a7da9e83e47 (patch)
treed7aa49e6ce3d10bcab1a79e3045425dad6906c40 /mm/memory_hotplug.c
parent3b7ec117bf6c98f5a845311c4ca5ca020a3d7689 (diff)
memory hotplug: memmap_init_zone called twice
__add_zone calls memmap_init_zone twice if memory gets attached to an empty zone. Once via init_currently_empty_zone and once explictly right after that call. Looks like this is currently not a bug, however the call is superfluous and might lead to subtle bugs if memmap_init_zone gets changed. So make sure it is called only once. Cc: Yasunori Goto <y-goto@jp.fujitsu.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Dave Hansen <haveblue@us.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory_hotplug.c')
-rw-r--r--mm/memory_hotplug.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index b17dca7249f8..988bd91b9f7f 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -167,13 +167,9 @@ static int __add_zone(struct zone *zone, unsigned long phys_start_pfn)
167 int zone_type; 167 int zone_type;
168 168
169 zone_type = zone - pgdat->node_zones; 169 zone_type = zone - pgdat->node_zones;
170 if (!zone->wait_table) { 170 if (!zone->wait_table)
171 int ret = 0; 171 return init_currently_empty_zone(zone, phys_start_pfn,
172 ret = init_currently_empty_zone(zone, phys_start_pfn, 172 nr_pages, MEMMAP_HOTPLUG);
173 nr_pages, MEMMAP_HOTPLUG);
174 if (ret < 0)
175 return ret;
176 }
177 memmap_init_zone(nr_pages, nid, zone_type, 173 memmap_init_zone(nr_pages, nid, zone_type,
178 phys_start_pfn, MEMMAP_HOTPLUG); 174 phys_start_pfn, MEMMAP_HOTPLUG);
179 return 0; 175 return 0;