Skip to contentSkip to conversation

(memory hotplug) Fix unnecessary calling of init_currenty_empty_zone()

PATCH New Yasunori Goto 1 participant 1 message May 29, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 (memory hotplug) Fix unnecessary calling of init_currenty_empty_zone()

Hello.

This patch is to fix unnecessary calling of init_currently_empty_zone().

zone->present_pages is updated in online_pages(). But, __add_zone() can be called twice or more before calling online_pages(). So, init_currenty_empty_zone() can be called unnecessary times. It is cause of memory leak of zone's wait_table.

This patch is tested on my ia64 box with 2.6.22-rc2-mm1.

 mm/memory_hotplug.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
mm/memory_hotplug.c +1 -1
Index: vmemmap/mm/memory_hotplug.c
===================================================================
@@ -65,7 +65,7 @@ static int __add_zone(struct zone *zone,
 	int zone_type;
 
 	zone_type = zone - pgdat->node_zones;
-	if (!populated_zone(zone)) {
+	if (!zone->wait_table) {
 		int ret = 0;
 		ret = init_currently_empty_zone(zone, phys_start_pfn,
 						nr_pages, MEMMAP_HOTPLUG);
Signature · 8 lines
Yasunori Goto 


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>