Skip to contentSkip to conversation

bdata and pgdat initialization cleanup [4/5] mod generic callers of alloc_bootmem_node

RFC PATCH New KAMEZAWA Hiroyuki 1 participant 1 message Feb 21, 2006

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

RFC PATCH 1/1 bdata and pgdat initialization cleanup [4/5] mod generic callers of alloc_bootmem_node

Modifies argments of alloc_bootmem_node().

mm/page_alloc.c +3 -5
Index: testtree/mm/page_alloc.c
===================================================================
@@ -2074,8 +2074,6 @@ static __meminit
 void zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
 {
 	int i;
-	struct pglist_data *pgdat = zone->zone_pgdat;
-
 	/*
 	 * The per-page waitqueue mechanism uses hashed waitqueues
 	 * per zone.
@@ -2083,8 +2081,8 @@ void zone_wait_table_init(struct zone *z
 	zone->wait_table_size = wait_table_size(zone_size_pages);
 	zone->wait_table_bits =	wait_table_bits(zone->wait_table_size);
 	zone->wait_table = (wait_queue_head_t *)
-		alloc_bootmem_node(pgdat, zone->wait_table_size
-					* sizeof(wait_queue_head_t));
+		alloc_bootmem_node(BOOTMEM(pgdat->node_id),
+			   zone->wait_table_size * sizeof(wait_queue_head_t));
 
 	for(i = 0; i < zone->wait_table_size; ++i)
 		init_waitqueue_head(zone->wait_table + i);
@@ -2197,7 +2195,7 @@ static void __init alloc_node_mem_map(st
 		size = (pgdat->node_spanned_pages + 1) * sizeof(struct page);
 		map = alloc_remap(pgdat->node_id, size);
 		if (!map)
-			map = alloc_bootmem_node(pgdat, size);
+			map = alloc_bootmem_node(BOOTMEM(pgdat->node_id), size);
 		pgdat->node_mem_map = map;
 	}
 #ifdef CONFIG_FLATMEM
mm/sparse.c +2 -2
Index: testtree/mm/sparse.c
===================================================================
@@ -32,7 +32,7 @@ static struct mem_section *sparse_index_
 	unsigned long array_size = SECTIONS_PER_ROOT *
 				   sizeof(struct mem_section);
 
-	section = alloc_bootmem_node(NODE_DATA(nid), array_size);
+	section = alloc_bootmem_node(BOOTMEM(nid), array_size);
 
 	if (section)
 		memset(section, 0, array_size);
@@ -179,7 +179,7 @@ static struct page *sparse_early_mem_map
 	if (map)
 		return map;
 
-	map = alloc_bootmem_node(NODE_DATA(nid),
+	map = alloc_bootmem_node(BOOTMEM(nid),
 			sizeof(struct page) * PAGES_PER_SECTION);
 	if (map)
 		return map;

--
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>