diff options
Diffstat (limited to 'include/linux/mempolicy.h')
-rw-r--r-- | include/linux/mempolicy.h | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index ed00b278cb93..c7ac77e873b3 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -22,6 +22,9 @@ | |||
22 | 22 | ||
23 | /* Flags for mbind */ | 23 | /* Flags for mbind */ |
24 | #define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */ | 24 | #define MPOL_MF_STRICT (1<<0) /* Verify existing pages in the mapping */ |
25 | #define MPOL_MF_MOVE (1<<1) /* Move pages owned by this process to conform to mapping */ | ||
26 | #define MPOL_MF_MOVE_ALL (1<<2) /* Move every page to conform to mapping */ | ||
27 | #define MPOL_MF_INTERNAL (1<<3) /* Internal flags start here */ | ||
25 | 28 | ||
26 | #ifdef __KERNEL__ | 29 | #ifdef __KERNEL__ |
27 | 30 | ||
@@ -65,6 +68,7 @@ struct mempolicy { | |||
65 | nodemask_t nodes; /* interleave */ | 68 | nodemask_t nodes; /* interleave */ |
66 | /* undefined for default */ | 69 | /* undefined for default */ |
67 | } v; | 70 | } v; |
71 | nodemask_t cpuset_mems_allowed; /* mempolicy relative to these nodes */ | ||
68 | }; | 72 | }; |
69 | 73 | ||
70 | /* | 74 | /* |
@@ -141,12 +145,21 @@ void mpol_free_shared_policy(struct shared_policy *p); | |||
141 | struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, | 145 | struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, |
142 | unsigned long idx); | 146 | unsigned long idx); |
143 | 147 | ||
144 | struct mempolicy *get_vma_policy(struct task_struct *task, | ||
145 | struct vm_area_struct *vma, unsigned long addr); | ||
146 | |||
147 | extern void numa_default_policy(void); | 148 | extern void numa_default_policy(void); |
148 | extern void numa_policy_init(void); | 149 | extern void numa_policy_init(void); |
149 | extern void numa_policy_rebind(const nodemask_t *old, const nodemask_t *new); | 150 | extern void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *new); |
151 | extern void mpol_rebind_task(struct task_struct *tsk, | ||
152 | const nodemask_t *new); | ||
153 | extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); | ||
154 | #define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x)) | ||
155 | |||
156 | #ifdef CONFIG_CPUSET | ||
157 | #define current_cpuset_is_being_rebound() \ | ||
158 | (cpuset_being_rebound == current->cpuset) | ||
159 | #else | ||
160 | #define current_cpuset_is_being_rebound() 0 | ||
161 | #endif | ||
162 | |||
150 | extern struct mempolicy default_policy; | 163 | extern struct mempolicy default_policy; |
151 | extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 164 | extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
152 | unsigned long addr); | 165 | unsigned long addr); |
@@ -159,6 +172,11 @@ static inline void check_highest_zone(int k) | |||
159 | policy_zone = k; | 172 | policy_zone = k; |
160 | } | 173 | } |
161 | 174 | ||
175 | int do_migrate_pages(struct mm_struct *mm, | ||
176 | const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags); | ||
177 | |||
178 | extern void *cpuset_being_rebound; /* Trigger mpol_copy vma rebind */ | ||
179 | |||
162 | #else | 180 | #else |
163 | 181 | ||
164 | struct mempolicy {}; | 182 | struct mempolicy {}; |
@@ -218,17 +236,35 @@ static inline void numa_default_policy(void) | |||
218 | { | 236 | { |
219 | } | 237 | } |
220 | 238 | ||
221 | static inline void numa_policy_rebind(const nodemask_t *old, | 239 | static inline void mpol_rebind_policy(struct mempolicy *pol, |
222 | const nodemask_t *new) | 240 | const nodemask_t *new) |
223 | { | 241 | { |
224 | } | 242 | } |
225 | 243 | ||
244 | static inline void mpol_rebind_task(struct task_struct *tsk, | ||
245 | const nodemask_t *new) | ||
246 | { | ||
247 | } | ||
248 | |||
249 | static inline void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new) | ||
250 | { | ||
251 | } | ||
252 | |||
253 | #define set_cpuset_being_rebound(x) do {} while (0) | ||
254 | |||
226 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 255 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
227 | unsigned long addr) | 256 | unsigned long addr) |
228 | { | 257 | { |
229 | return NODE_DATA(0)->node_zonelists + gfp_zone(GFP_HIGHUSER); | 258 | return NODE_DATA(0)->node_zonelists + gfp_zone(GFP_HIGHUSER); |
230 | } | 259 | } |
231 | 260 | ||
261 | static inline int do_migrate_pages(struct mm_struct *mm, | ||
262 | const nodemask_t *from_nodes, | ||
263 | const nodemask_t *to_nodes, int flags) | ||
264 | { | ||
265 | return 0; | ||
266 | } | ||
267 | |||
232 | static inline void check_highest_zone(int k) | 268 | static inline void check_highest_zone(int k) |
233 | { | 269 | { |
234 | } | 270 | } |