Commit:     6eaf806a223e61dc5f2de4ab591f11beb97a8f3b
Parent:     7ea1530ab3fdfa85441061909cc8040e84776fd4
Author:     Christoph Lameter <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 01:25:30 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 09:42:58 2007 -0700

    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 
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]>
    Tested-by: Lee Schermerhorn <[EMAIL PROTECTED]>
    Acked-by: Bob Picco <[EMAIL PROTECTED]>
    Cc: Mel Gorman <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 mm/mempolicy.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index ccbdb22..5daf63b 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -183,7 +183,9 @@ static struct mempolicy *mpol_new(int mode, nodemask_t 
        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);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to