aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mempolicy.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mempolicy.h')
-rw-r--r--include/linux/mempolicy.h46
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);
141struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, 145struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
142 unsigned long idx); 146 unsigned long idx);
143 147
144struct mempolicy *get_vma_policy(struct task_struct *task,
145 struct vm_area_struct *vma, unsigned long addr);
146
147extern void numa_default_policy(void); 148extern void numa_default_policy(void);
148extern void numa_policy_init(void); 149extern void numa_policy_init(void);
149extern void numa_policy_rebind(const nodemask_t *old, const nodemask_t *new); 150extern void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *new);
151extern void mpol_rebind_task(struct task_struct *tsk,
152 const nodemask_t *new);
153extern 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
150extern struct mempolicy default_policy; 163extern struct mempolicy default_policy;
151extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, 164extern 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
175int do_migrate_pages(struct mm_struct *mm,
176 const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags);
177
178extern void *cpuset_being_rebound; /* Trigger mpol_copy vma rebind */
179
162#else 180#else
163 181
164struct mempolicy {}; 182struct mempolicy {};
@@ -218,17 +236,35 @@ static inline void numa_default_policy(void)
218{ 236{
219} 237}
220 238
221static inline void numa_policy_rebind(const nodemask_t *old, 239static inline void mpol_rebind_policy(struct mempolicy *pol,
222 const nodemask_t *new) 240 const nodemask_t *new)
223{ 241{
224} 242}
225 243
244static inline void mpol_rebind_task(struct task_struct *tsk,
245 const nodemask_t *new)
246{
247}
248
249static 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
226static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, 255static 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
261static 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
232static inline void check_highest_zone(int k) 268static inline void check_highest_zone(int k)
233{ 269{
234} 270}