Skip to contentSkip to conversation

NUMA-Q: initialize pgdat_list later in boot

PATCH New William Lee Irwin III 1 participant 1 message Nov 12, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/9 NUMA-Q: initialize pgdat_list later in boot

In order to remove the assumption pgdat's off of node 0 are mapped early, this patch moves the linking of the pgdats off node 0 into the pgdat_list into zone_sizes_init().

There is also the cosmetic side-effect of ordering the nodes in a manner consistent with usual notions of their enumeration.

 discontig.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
arch/i386/mm/discontig.c +10 -7
diff -urpN numaq-2.5.47/arch/i386/mm/discontig.c 00_late_list/arch/i386/mm/discontig.c
@@ -251,13 +251,6 @@ unsigned long __init setup_memory(void)
 	 */
 	find_smp_config();
 
-	/*insert other nodes into pgdat_list*/
-	for (nid = 1; nid < numnodes; nid++){       
-		NODE_DATA(nid)->pgdat_next = pgdat_list;
-		pgdat_list = NODE_DATA(nid);
-	}
-       
-
 #ifdef CONFIG_BLK_DEV_INITRD
 	if (LOADER_TYPE && INITRD_START) {
 		if (INITRD_START + INITRD_SIZE <= (system_max_low_pfn << PAGE_SHIFT)) {
@@ -282,6 +275,16 @@ void __init zone_sizes_init(void)
 {
 	int nid;
 
+	/*
+	 * Insert nodes into pgdat_list backward so they appear in order.
+	 * Clobber node 0's links and NULL out pgdat_list before starting.
+	 */
+	pgdat_list = NULL;
+	for (nid = numnodes - 1; nid >= 0; nid--) {       
+		NODE_DATA(nid)->pgdat_next = pgdat_list;
+		pgdat_list = NODE_DATA(nid);
+	}
+
 	for (nid = 0; nid < numnodes; nid++) {
 		unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
 		unsigned int max_dma;