Paul, correcting himself ...
No and yes. The manner in which too many nodes (as requested in a
RELATIVE mask) are folded into too small a cpuset is not actually
that critical, so long as it doesn't come up empty. However, what
I'll be recommending, in a follow-up patch, will be folding the
larger set into the smaller one modulo the size of the smaller one.
In your example above, the requested policy asked for nodes 2-4,
so that means it is trying to lay out a memory policy with at least
five (0-4) nodes in consideration. But the cpuset is only allowing
three (1-3) nodes at the moment. So for each requested node, we take
its number modulo three to see which of the available nodes to include
in the interleave.
Given
N: how many nodes are allowed by the tasks cpuset (3, here)
n m := (n % N) r := m-th set node in allowed
requested mod 3 result (in set 1, 2, 3 allowed)
2 2 3
3 0 1
4 1 2
Hence your first example would result in an interleave over physical
nodes 1, 2, and 3 (the last column above.) ... not just over 3.
I intend to post patches you can use to lib/bitmap.c and the related
cpumask and nodemask apparatus that compute the above for you.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.940.382.4214
--