Thread (1 message) 1 message, 1 author, 2007-07-11

Re: [patch 02/12] NUMA: Introduce node_memory_map

From: Nishanth Aravamudan <hidden>
Date: 2007-07-11 16:17:47

On 10.07.2007 [14:52:07 -0700], Christoph Lameter wrote:
It is necessary to know if nodes have memory since we have recently
begun to add support for memoryless nodes. For that purpose we introduce
a new node state N_MEMORY.

A node has its bit in node_memory_map set if it has memory. If a node
has memory then it has at least one zone defined in its pgdat structure
that is located in the pgdat itself.
Uh, except node_memory_map is not defined below.

I'm guessing you just need

#define	node_memory_map	node_states[N_MEMORY]

below.

Thanks,
Nish
quoted hunk
N_MEMORY can then be used in various places to insure that we
do the right thing when we encounter a memoryless node.

Signed-off-by: Lee Schermerhorn <redacted>
Signed-off-by: Nishanth Aravamudan <redacted>
Signed-off-by: Christoph Lameter <redacted>

---
 include/linux/nodemask.h |    1 +
 mm/page_alloc.c          |    9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

Index: linux-2.6.22-rc6-mm1/include/linux/nodemask.h
===================================================================
--- linux-2.6.22-rc6-mm1.orig/include/linux/nodemask.h	2007-07-09 22:13:44.000000000 -0700
+++ linux-2.6.22-rc6-mm1/include/linux/nodemask.h	2007-07-09 22:16:05.000000000 -0700
@@ -343,6 +343,7 @@ static inline void __nodes_remap(nodemas
 enum node_states {
 	N_POSSIBLE,	/* The node could become online at some point */
 	N_ONLINE,	/* The node is online */
+	N_MEMORY,	/* The node has memory */
 	NR_NODE_STATES
 };
Index: linux-2.6.22-rc6-mm1/mm/page_alloc.c
===================================================================
--- linux-2.6.22-rc6-mm1.orig/mm/page_alloc.c	2007-07-09 22:15:45.000000000 -0700
+++ linux-2.6.22-rc6-mm1/mm/page_alloc.c	2007-07-09 22:19:28.000000000 -0700
@@ -2392,8 +2392,13 @@ static int __build_all_zonelists(void *d
 	int nid;

 	for_each_online_node(nid) {
-		build_zonelists(NODE_DATA(nid));
-		build_zonelist_cache(NODE_DATA(nid));
+		pg_data_t *pgdat = NODE_DATA(nid);
+
+		build_zonelists(pgdat);
+		build_zonelist_cache(pgdat);
+
+		if (pgdat->node_present_pages)
+			node_set_state(nid, N_MEMORY);
 	}
 	return 0;
 }
-- 
-- 
Nishanth Aravamudan [off-list ref]
IBM Linux Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help