aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-10-16 04:25:30 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:42:58 -0400
commit6eaf806a223e61dc5f2de4ab591f11beb97a8f3b (patch)
treefd63b422c3cb357792d12f9170c354e25b94daa0
parent7ea1530ab3fdfa85441061909cc8040e84776fd4 (diff)
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 <clameter@sgi.com> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Tested-by: Lee Schermerhorn <lee.schermerhorn@hp.com> Acked-by: Bob Picco <bob.picco@hp.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Mel Gorman <mel@skynet.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/mempolicy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index ccbdb22147bb..5daf63bd97e7 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -183,7 +183,9 @@ static struct mempolicy *mpol_new(int mode, nodemask_t *nodes)
183 switch (mode) { 183 switch (mode) {
184 case MPOL_INTERLEAVE: 184 case MPOL_INTERLEAVE:
185 policy->v.nodes = *nodes; 185 policy->v.nodes = *nodes;
186 if (nodes_weight(*nodes) == 0) { 186 nodes_and(policy->v.nodes, policy->v.nodes,
187 node_states[N_HIGH_MEMORY]);
188 if (nodes_weight(policy->v.nodes) == 0) {
187 kmem_cache_free(policy_cache, policy); 189 kmem_cache_free(policy_cache, policy);
188 return ERR_PTR(-EINVAL); 190 return ERR_PTR(-EINVAL);
189 } 191 }