Re: [PATCH 1/2] Zone reclaim V2

From: Christoph Lameter
Date: Tue Dec 06 2005 - 13:41:29 EST


On Tue, 6 Dec 2005, Andi Kleen wrote:

> I would enable it if distance for any combination of online (or possible?) nodes is
> > LOCAL_DISTANCE. I guess hotplug can be ignored for now.
>
> If an architecture really needs something better it can be still refined. But there aren't
> that many NUMA architectures anyways, so it shouldn't be a big issue.
>
> It will actually need some tweaking on Opterons because many BIOS just
> report 10 everywhere in SLIT and it should be still enabled, but that can be done
> in the architecture then.

Here is a patch that may do what you want. The LOCAL_DISTANCE may have to
be set per arch and we may need a reasonable default:


Index: linux-2.6.15-rc4/mm/page_alloc.c
===================================================================
--- linux-2.6.15-rc4.orig/mm/page_alloc.c 2005-12-06 10:30:35.000000000 -0800
+++ linux-2.6.15-rc4/mm/page_alloc.c 2005-12-06 10:35:03.000000000 -0800
@@ -1561,13 +1561,17 @@ static void __init build_zonelists(pg_da
prev_node = local_node;
nodes_clear(used_mask);
while ((node = find_next_best_node(local_node, &used_mask)) >= 0) {
+ int distance = node_distance(local_node, node);
/*
* We don't want to pressure a particular node.
* So adding penalty to the first node in same
* distance group to make it round-robin.
*/
- if (node_distance(local_node, node) !=
- node_distance(local_node, prev_node))
+
+ if (distance > LOCAL_DISTANCE)
+ zone_reclaim_mode = 1;
+
+ if (distance != node_distance(local_node, prev_node))
node_load[node] += load;
prev_node = node;
load--;
Index: linux-2.6.15-rc4/include/linux/numa.h
===================================================================
--- linux-2.6.15-rc4.orig/include/linux/numa.h 2005-11-30 22:25:15.000000000 -0800
+++ linux-2.6.15-rc4/include/linux/numa.h 2005-12-06 10:32:49.000000000 -0800
@@ -13,4 +13,8 @@

#define MAX_NUMNODES (1 << NODES_SHIFT)

+#ifndef LOCAL_DISTANCE
+#define LOCAL_DISTANCE 10
+#endif
+
#endif /* _LINUX_NUMA_H */


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/