[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080509060425.GA9840@osiris.boeblingen.de.ibm.com>
Date: Fri, 9 May 2008 08:04:25 +0200
From: Heiko Carstens <heiko.carstens@...ibm.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Yasunori Goto <y-goto@...fujitsu.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Dave Hansen <haveblue@...ibm.com>,
Gerald Schaefer <gerald.schaefer@...ibm.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH] memory hotplug: memmap_init_zone called twice.
Subject: [PATCH] memory hotplug: memmap_init_zone called twice.
From: Heiko Carstens <heiko.carstens@...ibm.com>
__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@...fujitsu.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: Dave Hansen <haveblue@...ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@...ibm.com>
---
mm/memory_hotplug.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
Index: linux-2.6/mm/memory_hotplug.c
===================================================================
--- linux-2.6.orig/mm/memory_hotplug.c
+++ linux-2.6/mm/memory_hotplug.c
@@ -167,13 +167,9 @@ static int __add_zone(struct zone *zone,
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists