From: Christoph Lameter Currently one can specify an arbitrary node mask to mbind that includes nodes not allowed. If that is done with an interleave policy then we will go around all the nodes. Those outside of the currently allowed cpuset will be redirected to the border nodes. Interleave will then create imbalances at the borders of the cpuset. This patch restricts the nodes to the currently allowed cpuset. The RFC for this patch was discussed at http://marc.theaimsgroup.com/?t=116793842100004&r=1&w=2 Signed-off-by: Christoph Lameter Cc: Paul Jackson Cc: Andi Kleen Signed-off-by: Andrew Morton --- mm/mempolicy.c | 1 + 1 files changed, 1 insertion(+) diff -puN mm/mempolicy.c~mbind-restrict-nodes-to-the-currently-allowed-cpuset mm/mempolicy.c --- a/mm/mempolicy.c~mbind-restrict-nodes-to-the-currently-allowed-cpuset +++ a/mm/mempolicy.c @@ -882,6 +882,7 @@ asmlinkage long sys_mbind(unsigned long int err; err = get_nodes(&nodes, nmask, maxnode); + nodes_and(nodes, nodes, current->mems_allowed); if (err) return err; return do_mbind(start, len, mode, &nodes, flags); _