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 */