]> Git Repo - linux.git/commitdiff
memory hotplug: memmap_init_zone called twice
authorHeiko Carstens <[email protected]>
Wed, 14 May 2008 23:05:40 +0000 (16:05 -0700)
committerLinus Torvalds <[email protected]>
Thu, 15 May 2008 02:11:14 +0000 (19:11 -0700)
__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 <[email protected]>
Acked-by: KAMEZAWA Hiroyuki <[email protected]>
Cc: Dave Hansen <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/memory_hotplug.c

index b17dca7249f8a41e0806e4465291f1dd2eba4913..988bd91b9f7fdd8460d2b94dbf18d05aa57d431a 100644 (file)
@@ -167,13 +167,9 @@ static int __add_zone(struct zone *zone, unsigned long phys_start_pfn)
        int zone_type;
 
        zone_type = zone - pgdat->node_zones;
-       if (!zone->wait_table) {
-               int ret = 0;
-               ret = init_currently_empty_zone(zone, phys_start_pfn,
-                                               nr_pages, MEMMAP_HOTPLUG);
-               if (ret < 0)
-                       return ret;
-       }
+       if (!zone->wait_table)
+               return init_currently_empty_zone(zone, phys_start_pfn,
+                                                nr_pages, MEMMAP_HOTPLUG);
        memmap_init_zone(nr_pages, nid, zone_type,
                         phys_start_pfn, MEMMAP_HOTPLUG);
        return 0;
This page took 0.053103 seconds and 4 git commands to generate.