aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mempolicy.h20
-rw-r--r--include/linux/shmem_fs.h1
2 files changed, 18 insertions, 3 deletions
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 389a06e8ee21..f2bab4d2fc40 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -8,6 +8,12 @@
8 * Copyright 2003,2004 Andi Kleen SuSE Labs 8 * Copyright 2003,2004 Andi Kleen SuSE Labs
9 */ 9 */
10 10
11/*
12 * Both the MPOL_* mempolicy mode and the MPOL_F_* optional mode flags are
13 * passed by the user to either set_mempolicy() or mbind() in an 'int' actual.
14 * The MPOL_MODE_FLAGS macro determines the legal set of optional mode flags.
15 */
16
11/* Policies */ 17/* Policies */
12enum { 18enum {
13 MPOL_DEFAULT, 19 MPOL_DEFAULT,
@@ -17,7 +23,14 @@ enum {
17 MPOL_MAX, /* always last member of enum */ 23 MPOL_MAX, /* always last member of enum */
18}; 24};
19 25
20/* Flags for get_mem_policy */ 26/* Flags for set_mempolicy */
27/*
28 * MPOL_MODE_FLAGS is the union of all possible optional mode flags passed to
29 * either set_mempolicy() or mbind().
30 */
31#define MPOL_MODE_FLAGS (0)
32
33/* Flags for get_mempolicy */
21#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */ 34#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */
22#define MPOL_F_ADDR (1<<1) /* look up vma using address */ 35#define MPOL_F_ADDR (1<<1) /* look up vma using address */
23#define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */ 36#define MPOL_F_MEMS_ALLOWED (1<<2) /* return allowed memories */
@@ -66,6 +79,7 @@ struct mm_struct;
66struct mempolicy { 79struct mempolicy {
67 atomic_t refcnt; 80 atomic_t refcnt;
68 unsigned short policy; /* See MPOL_* above */ 81 unsigned short policy; /* See MPOL_* above */
82 unsigned short flags; /* See set_mempolicy() MPOL_F_* above */
69 union { 83 union {
70 short preferred_node; /* preferred */ 84 short preferred_node; /* preferred */
71 nodemask_t nodes; /* interleave/bind */ 85 nodemask_t nodes; /* interleave/bind */
@@ -136,7 +150,7 @@ struct shared_policy {
136}; 150};
137 151
138void mpol_shared_policy_init(struct shared_policy *info, unsigned short policy, 152void mpol_shared_policy_init(struct shared_policy *info, unsigned short policy,
139 nodemask_t *nodes); 153 unsigned short flags, nodemask_t *nodes);
140int mpol_set_shared_policy(struct shared_policy *info, 154int mpol_set_shared_policy(struct shared_policy *info,
141 struct vm_area_struct *vma, 155 struct vm_area_struct *vma,
142 struct mempolicy *new); 156 struct mempolicy *new);
@@ -203,7 +217,7 @@ static inline int mpol_set_shared_policy(struct shared_policy *info,
203} 217}
204 218
205static inline void mpol_shared_policy_init(struct shared_policy *info, 219static inline void mpol_shared_policy_init(struct shared_policy *info,
206 unsigned short policy, nodemask_t *nodes) 220 unsigned short policy, unsigned short flags, nodemask_t *nodes)
207{ 221{
208} 222}
209 223
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 639a4070708e..d7699a628d78 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -35,6 +35,7 @@ struct shmem_sb_info {
35 gid_t gid; /* Mount gid for root directory */ 35 gid_t gid; /* Mount gid for root directory */
36 mode_t mode; /* Mount mode for root directory */ 36 mode_t mode; /* Mount mode for root directory */
37 unsigned short policy; /* Default NUMA memory alloc policy */ 37 unsigned short policy; /* Default NUMA memory alloc policy */
38 unsigned short flags; /* Optional mempolicy flags */
38 nodemask_t policy_nodes; /* nodemask for preferred and bind */ 39 nodemask_t policy_nodes; /* nodemask for preferred and bind */
39}; 40};
40 41