diff options
author | David Rientjes <rientjes@google.com> | 2008-04-28 05:12:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:19 -0400 |
commit | 4c50bc0116cf3cc35e7152d6a8424b4db65f52d6 (patch) | |
tree | 99c617602cc1946fc86b48e9a35f14f9f354cf67 /include/linux | |
parent | 7ea931c9fc80c4d0a4306c30ec92eb0f1d922a0b (diff) |
mempolicy: add MPOL_F_RELATIVE_NODES flag
Adds another optional mode flag, MPOL_F_RELATIVE_NODES, that specifies
nodemasks passed via set_mempolicy() or mbind() should be considered relative
to the current task's mems_allowed.
When the mempolicy is created, the passed nodemask is folded and mapped onto
the current task's mems_allowed. For example, consider a task using
set_mempolicy() to pass MPOL_INTERLEAVE | MPOL_F_RELATIVE_NODES with a
nodemask of 1-3. If current's mems_allowed is 4-7, the effected nodemask is
5-7 (the second, third, and fourth node of mems_allowed).
If the same task is attached to a cpuset, the mempolicy nodemask is rebound
each time the mems are changed. Some possible rebinds and results are:
mems result
1-3 1-3
1-7 2-4
1,5-6 1,5-6
1,5-7 5-7
Likewise, the zonelist built for MPOL_BIND acts on the set of zones assigned
to the resultant nodemask from the relative remap.
In the MPOL_PREFERRED case, the preferred node is remapped from the currently
effected nodemask to the relative nodemask.
This mempolicy mode flag was conceived of by Paul Jackson <pj@sgi.com>.
Cc: Paul Jackson <pj@sgi.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mempolicy.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 07350d7b8d96..02b11efd7066 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -25,12 +25,13 @@ enum { | |||
25 | 25 | ||
26 | /* Flags for set_mempolicy */ | 26 | /* Flags for set_mempolicy */ |
27 | #define MPOL_F_STATIC_NODES (1 << 15) | 27 | #define MPOL_F_STATIC_NODES (1 << 15) |
28 | #define MPOL_F_RELATIVE_NODES (1 << 14) | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to | 31 | * MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to |
31 | * either set_mempolicy() or mbind(). | 32 | * either set_mempolicy() or mbind(). |
32 | */ | 33 | */ |
33 | #define MPOL_MODE_FLAGS (MPOL_F_STATIC_NODES) | 34 | #define MPOL_MODE_FLAGS (MPOL_F_STATIC_NODES | MPOL_F_RELATIVE_NODES) |
34 | 35 | ||
35 | /* Flags for get_mempolicy */ | 36 | /* Flags for get_mempolicy */ |
36 | #define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */ | 37 | #define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */ |