diff options
Diffstat (limited to 'include/linux/mempolicy.h')
| -rw-r--r-- | include/linux/mempolicy.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 1cc966cd3e5f..31ac26ca4acf 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
| @@ -23,6 +23,13 @@ enum { | |||
| 23 | MPOL_MAX, /* always last member of enum */ | 23 | MPOL_MAX, /* always last member of enum */ |
| 24 | }; | 24 | }; |
| 25 | 25 | ||
| 26 | enum mpol_rebind_step { | ||
| 27 | MPOL_REBIND_ONCE, /* do rebind work at once(not by two step) */ | ||
| 28 | MPOL_REBIND_STEP1, /* first step(set all the newly nodes) */ | ||
| 29 | MPOL_REBIND_STEP2, /* second step(clean all the disallowed nodes)*/ | ||
| 30 | MPOL_REBIND_NSTEP, | ||
| 31 | }; | ||
| 32 | |||
| 26 | /* Flags for set_mempolicy */ | 33 | /* Flags for set_mempolicy */ |
| 27 | #define MPOL_F_STATIC_NODES (1 << 15) | 34 | #define MPOL_F_STATIC_NODES (1 << 15) |
| 28 | #define MPOL_F_RELATIVE_NODES (1 << 14) | 35 | #define MPOL_F_RELATIVE_NODES (1 << 14) |
| @@ -51,6 +58,7 @@ enum { | |||
| 51 | */ | 58 | */ |
| 52 | #define MPOL_F_SHARED (1 << 0) /* identify shared policies */ | 59 | #define MPOL_F_SHARED (1 << 0) /* identify shared policies */ |
| 53 | #define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */ | 60 | #define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */ |
| 61 | #define MPOL_F_REBINDING (1 << 2) /* identify policies in rebinding */ | ||
| 54 | 62 | ||
| 55 | #ifdef __KERNEL__ | 63 | #ifdef __KERNEL__ |
| 56 | 64 | ||
| @@ -193,8 +201,8 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, | |||
| 193 | 201 | ||
| 194 | extern void numa_default_policy(void); | 202 | extern void numa_default_policy(void); |
| 195 | extern void numa_policy_init(void); | 203 | extern void numa_policy_init(void); |
| 196 | extern void mpol_rebind_task(struct task_struct *tsk, | 204 | extern void mpol_rebind_task(struct task_struct *tsk, const nodemask_t *new, |
| 197 | const nodemask_t *new); | 205 | enum mpol_rebind_step step); |
| 198 | extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); | 206 | extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); |
| 199 | extern void mpol_fix_fork_child_flag(struct task_struct *p); | 207 | extern void mpol_fix_fork_child_flag(struct task_struct *p); |
| 200 | 208 | ||
| @@ -202,6 +210,8 @@ extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, | |||
| 202 | unsigned long addr, gfp_t gfp_flags, | 210 | unsigned long addr, gfp_t gfp_flags, |
| 203 | struct mempolicy **mpol, nodemask_t **nodemask); | 211 | struct mempolicy **mpol, nodemask_t **nodemask); |
| 204 | extern bool init_nodemask_of_mempolicy(nodemask_t *mask); | 212 | extern bool init_nodemask_of_mempolicy(nodemask_t *mask); |
| 213 | extern bool mempolicy_nodemask_intersects(struct task_struct *tsk, | ||
| 214 | const nodemask_t *mask); | ||
| 205 | extern unsigned slab_node(struct mempolicy *policy); | 215 | extern unsigned slab_node(struct mempolicy *policy); |
| 206 | 216 | ||
| 207 | extern enum zone_type policy_zone; | 217 | extern enum zone_type policy_zone; |
| @@ -308,7 +318,8 @@ static inline void numa_default_policy(void) | |||
| 308 | } | 318 | } |
| 309 | 319 | ||
| 310 | static inline void mpol_rebind_task(struct task_struct *tsk, | 320 | static inline void mpol_rebind_task(struct task_struct *tsk, |
| 311 | const nodemask_t *new) | 321 | const nodemask_t *new, |
| 322 | enum mpol_rebind_step step) | ||
| 312 | { | 323 | { |
| 313 | } | 324 | } |
| 314 | 325 | ||
| @@ -329,7 +340,16 @@ static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, | |||
| 329 | return node_zonelist(0, gfp_flags); | 340 | return node_zonelist(0, gfp_flags); |
| 330 | } | 341 | } |
| 331 | 342 | ||
| 332 | static inline bool init_nodemask_of_mempolicy(nodemask_t *m) { return false; } | 343 | static inline bool init_nodemask_of_mempolicy(nodemask_t *m) |
| 344 | { | ||
| 345 | return false; | ||
| 346 | } | ||
| 347 | |||
| 348 | static inline bool mempolicy_nodemask_intersects(struct task_struct *tsk, | ||
| 349 | const nodemask_t *mask) | ||
| 350 | { | ||
| 351 | return false; | ||
| 352 | } | ||
| 333 | 353 | ||
| 334 | static inline int do_migrate_pages(struct mm_struct *mm, | 354 | static inline int do_migrate_pages(struct mm_struct *mm, |
| 335 | const nodemask_t *from_nodes, | 355 | const nodemask_t *from_nodes, |
