patch-2.4.0-test6 linux/mm/numa.c

Next file: linux/mm/page_alloc.c
Previous file: linux/mm/memory.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test5/linux/mm/numa.c linux/mm/numa.c
@@ -86,18 +86,24 @@
 struct page * alloc_pages(int gfp_mask, unsigned long order)
 {
 	struct page *ret = 0;
-	unsigned long flags;
 	int startnode, tnode;
+#ifndef CONFIG_NUMA
+	unsigned long flags;
 	static int nextnid = 0;
+#endif
 
 	if (order >= MAX_ORDER)
 		return NULL;
+#ifdef CONFIG_NUMA
+	tnode = numa_node_id();
+#else
 	spin_lock_irqsave(&node_lock, flags);
 	tnode = nextnid;
 	nextnid++;
 	if (nextnid == numnodes)
 		nextnid = 0;
 	spin_unlock_irqrestore(&node_lock, flags);
+#endif
 	startnode = tnode;
 	while (tnode < numnodes) {
 		if ((ret = alloc_pages_node(tnode++, gfp_mask, order)))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)