Skip to content

Commit

Permalink
[PATCH] mbind: restrict nodes to the currently allowed cpuset
Browse files Browse the repository at this point in the history
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 <clameter@sgi.com>
Cc: Paul Jackson <pj@sgi.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Jan 23, 2007
1 parent 79603a3 commit 30150f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mm/mempolicy.c
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,10 @@ asmlinkage long sys_mbind(unsigned long start, unsigned long len,
err = get_nodes(&nodes, nmask, maxnode);
if (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);
}

Expand Down

0 comments on commit 30150f8

Please sign in to comment.