mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-14 21:01:29 +00:00
[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=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>
This commit is contained in:
parent
79603a3500
commit
30150f8d7b
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user