Commit 30150f8d authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds

[PATCH] mbind: restrict nodes to the currently allowed cpuset

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=2Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
Cc: Paul Jackson <pj@sgi.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 79603a35
...@@ -884,6 +884,10 @@ asmlinkage long sys_mbind(unsigned long start, unsigned long len, ...@@ -884,6 +884,10 @@ asmlinkage long sys_mbind(unsigned long start, unsigned long len,
err = get_nodes(&nodes, nmask, maxnode); err = get_nodes(&nodes, nmask, maxnode);
if (err) if (err)
return err; return err;
#ifdef CONFIG_CPUSETS
/* Restrict the nodes to the allowed nodes in the cpuset */
nodes_and(nodes, nodes, current->mems_allowed);
#endif
return do_mbind(start, len, mode, &nodes, flags); return do_mbind(start, len, mode, &nodes, flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment