Commit c3723ca3 authored by Heiko Carstens's avatar Heiko Carstens Committed by Linus Torvalds

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: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3b7ec117
...@@ -167,13 +167,9 @@ static int __add_zone(struct zone *zone, unsigned long phys_start_pfn) ...@@ -167,13 +167,9 @@ static int __add_zone(struct zone *zone, unsigned long phys_start_pfn)
int zone_type; int zone_type;
zone_type = zone - pgdat->node_zones; zone_type = zone - pgdat->node_zones;
if (!zone->wait_table) { if (!zone->wait_table)
int ret = 0; return init_currently_empty_zone(zone, phys_start_pfn,
ret = init_currently_empty_zone(zone, phys_start_pfn, nr_pages, MEMMAP_HOTPLUG);
nr_pages, MEMMAP_HOTPLUG);
if (ret < 0)
return ret;
}
memmap_init_zone(nr_pages, nid, zone_type, memmap_init_zone(nr_pages, nid, zone_type,
phys_start_pfn, MEMMAP_HOTPLUG); phys_start_pfn, MEMMAP_HOTPLUG);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment