From 7500a1a8f62c7ab25cdcca7cf18462541a696012 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Fri, 27 Jul 2007 15:43:35 -0400 Subject: [PATCH] Memoryless Nodes: Fix interleave behavior Memoryless Nodes: Fix interleave behavior for memoryless nodes MPOL_INTERLEAVE currently simply loops over all nodes. Allocations on memoryless nodes will be redirected to nodes with memory. This results in an imbalance because the neighboring nodes to memoryless nodes will get significantly more interleave hits that the rest of the nodes on the system. We can avoid this imbalance by clearing the nodes in the interleave node set that have no memory. If we use the node map of the memory nodes instead of the online nodes then we have only the nodes we want. Signed-off-by: Christoph Lameter Signed-off-by: Nishanth Aravamudan Tested-by: Lee Schermerhorn Acked-by: Bob Picco --- mm/mempolicy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-2.6/mm/mempolicy.c =================================================================== --- linux-2.6.orig/mm/mempolicy.c 2007-07-31 21:08:00.000000000 -0700 +++ linux-2.6/mm/mempolicy.c 2007-07-31 21:19:04.000000000 -0700 @@ -185,7 +185,9 @@ static struct mempolicy *mpol_new(int mo switch (mode) { case MPOL_INTERLEAVE: policy->v.nodes = *nodes; - if (nodes_weight(*nodes) == 0) { + nodes_and(policy->v.nodes, policy->v.nodes, + node_states[N_HIGH_MEMORY]); + if (nodes_weight(policy->v.nodes) == 0) { kmem_cache_free(policy_cache, policy); return ERR_PTR(-EINVAL); }