[PATCH] for_each_online_pgdat (take2) [4/5] remove sorting pgdat

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Because pgdat_list was linked to pgdat_list in *reverse* order,
(By default) some of arch has to sort it by themselves.

for_each_pgdat has gone..for_each_online_pgdat() uses node_online_map,
which doesn't need to be sorted.

This patch removes codes for sorting pgdat.

Signed-Off-By: KAMEZAWA Hiroyuki <[email protected]>


Index: linux-2.6.16-rc4-mm2/arch/m32r/mm/discontig.c
===================================================================
--- linux-2.6.16-rc4-mm2.orig/arch/m32r/mm/discontig.c	2006-02-25 13:02:37.000000000 +0900
+++ linux-2.6.16-rc4-mm2/arch/m32r/mm/discontig.c	2006-02-25 13:10:53.000000000 +0900
@@ -137,12 +137,6 @@
 	int nid, i;
 	mem_prof_t *mp;
 
-	pgdat_list = NULL;
-	for (nid = num_online_nodes() - 1 ; nid >= 0 ; nid--) {
-		NODE_DATA(nid)->pgdat_next = pgdat_list;
-		pgdat_list = NODE_DATA(nid);
-	}
-
 	for_each_online_node(nid) {
 		mp = &mem_prof[nid];
 		for (i = 0 ; i < MAX_NR_ZONES ; i++) {
Index: linux-2.6.16-rc4-mm2/arch/ia64/mm/discontig.c
===================================================================
--- linux-2.6.16-rc4-mm2.orig/arch/ia64/mm/discontig.c	2006-02-25 13:10:52.000000000 +0900
+++ linux-2.6.16-rc4-mm2/arch/ia64/mm/discontig.c	2006-02-25 13:10:53.000000000 +0900
@@ -379,31 +379,6 @@
 }
 
 /**
- * pgdat_insert - insert the pgdat into global pgdat_list
- * @pgdat: the pgdat for a node.
- */
-static void __init pgdat_insert(pg_data_t *pgdat)
-{
-	pg_data_t *prev = NULL, *next;
-
-	for_each_online_pgdat(next)
-		if (pgdat->node_id < next->node_id)
-			break;
-		else
-			prev = next;
-
-	if (prev) {
-		prev->pgdat_next = pgdat;
-		pgdat->pgdat_next = next;
-	} else {
-		pgdat->pgdat_next = pgdat_list;
-		pgdat_list = pgdat;
-	}
-
-	return;
-}
-
-/**
  * memory_less_nodes - allocate and initialize CPU only nodes pernode
  *	information.
  */
@@ -745,11 +720,5 @@
 				    pfn_offset, zholes_size);
 	}
 
-	/*
-	 * Make memory less nodes become a member of the known nodes.
-	 */
-	for_each_node_mask(node, memory_less_mask)
-		pgdat_insert(mem_data[node].pgdat);
-
 	zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
 }
Index: linux-2.6.16-rc4-mm2/arch/i386/mm/discontig.c
===================================================================
--- linux-2.6.16-rc4-mm2.orig/arch/i386/mm/discontig.c	2006-02-25 13:02:37.000000000 +0900
+++ linux-2.6.16-rc4-mm2/arch/i386/mm/discontig.c	2006-02-25 13:10:53.000000000 +0900
@@ -352,17 +352,6 @@
 {
 	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 = MAX_NUMNODES - 1; nid >= 0; nid--) {
-		if (!node_online(nid))
-			continue;
-		NODE_DATA(nid)->pgdat_next = pgdat_list;
-		pgdat_list = NODE_DATA(nid);
-	}
 
 	for_each_online_node(nid) {
 		unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0};
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux