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.h58
1 files changed, 46 insertions, 12 deletions
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index ed00b278cb93..bbd2221923c3 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/*
@@ -128,12 +132,8 @@ struct shared_policy {
128 spinlock_t lock; 132 spinlock_t lock;
129}; 133};
130 134
131static inline void mpol_shared_policy_init(struct shared_policy *info) 135void mpol_shared_policy_init(struct shared_policy *info, int policy,
132{ 136 nodemask_t *nodes);
133 info->root = RB_ROOT;
134 spin_lock_init(&info->lock);
135}
136
137int mpol_set_shared_policy(struct shared_policy *info, 137int mpol_set_shared_policy(struct shared_policy *info,
138 struct vm_area_struct *vma, 138 struct vm_area_struct *vma,
139 struct mempolicy *new); 139 struct mempolicy *new);
@@ -141,15 +141,25 @@ void mpol_free_shared_policy(struct shared_policy *p);
141struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, 141struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
142 unsigned long idx); 142 unsigned long idx);
143 143
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); 144extern void numa_default_policy(void);
148extern void numa_policy_init(void); 145extern void numa_policy_init(void);
149extern void numa_policy_rebind(const nodemask_t *old, const nodemask_t *new); 146extern void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *new);
147extern void mpol_rebind_task(struct task_struct *tsk,
148 const nodemask_t *new);
149extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
150#define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x))
151
152#ifdef CONFIG_CPUSET
153#define current_cpuset_is_being_rebound() \
154 (cpuset_being_rebound == current->cpuset)
155#else
156#define current_cpuset_is_being_rebound() 0
157#endif
158
150extern struct mempolicy default_policy; 159extern struct mempolicy default_policy;
151extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, 160extern struct zonelist *huge_zonelist(struct vm_area_struct *vma,
152 unsigned long addr); 161 unsigned long addr);
162extern unsigned slab_node(struct mempolicy *policy);
153 163
154extern int policy_zone; 164extern int policy_zone;
155 165
@@ -159,6 +169,11 @@ static inline void check_highest_zone(int k)
159 policy_zone = k; 169 policy_zone = k;
160} 170}
161 171
172int do_migrate_pages(struct mm_struct *mm,
173 const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags);
174
175extern void *cpuset_being_rebound; /* Trigger mpol_copy vma rebind */
176
162#else 177#else
163 178
164struct mempolicy {}; 179struct mempolicy {};
@@ -193,7 +208,8 @@ static inline int mpol_set_shared_policy(struct shared_policy *info,
193 return -EINVAL; 208 return -EINVAL;
194} 209}
195 210
196static inline void mpol_shared_policy_init(struct shared_policy *info) 211static inline void mpol_shared_policy_init(struct shared_policy *info,
212 int policy, nodemask_t *nodes)
197{ 213{
198} 214}
199 215
@@ -218,17 +234,35 @@ static inline void numa_default_policy(void)
218{ 234{
219} 235}
220 236
221static inline void numa_policy_rebind(const nodemask_t *old, 237static inline void mpol_rebind_policy(struct mempolicy *pol,
238 const nodemask_t *new)
239{
240}
241
242static inline void mpol_rebind_task(struct task_struct *tsk,
222 const nodemask_t *new) 243 const nodemask_t *new)
223{ 244{
224} 245}
225 246
247static inline void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new)
248{
249}
250
251#define set_cpuset_being_rebound(x) do {} while (0)
252
226static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, 253static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma,
227 unsigned long addr) 254 unsigned long addr)
228{ 255{
229 return NODE_DATA(0)->node_zonelists + gfp_zone(GFP_HIGHUSER); 256 return NODE_DATA(0)->node_zonelists + gfp_zone(GFP_HIGHUSER);
230} 257}
231 258
259static inline int do_migrate_pages(struct mm_struct *mm,
260 const nodemask_t *from_nodes,
261 const nodemask_t *to_nodes, int flags)
262{
263 return 0;
264}
265
232static inline void check_highest_zone(int k) 266static inline void check_highest_zone(int k)
233{ 267{
234} 268}