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.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 3a39570b81b8..085c903fe0f1 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -59,6 +59,7 @@ enum {
59#include <linux/rbtree.h> 59#include <linux/rbtree.h>
60#include <linux/spinlock.h> 60#include <linux/spinlock.h>
61#include <linux/nodemask.h> 61#include <linux/nodemask.h>
62#include <linux/pagemap.h>
62 63
63struct mm_struct; 64struct mm_struct;
64 65
@@ -220,6 +221,24 @@ extern int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context);
220extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, 221extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol,
221 int no_context); 222 int no_context);
222#endif 223#endif
224
225/* Check if a vma is migratable */
226static inline int vma_migratable(struct vm_area_struct *vma)
227{
228 if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED))
229 return 0;
230 /*
231 * Migration allocates pages in the highest zone. If we cannot
232 * do so then migration (at least from node to node) is not
233 * possible.
234 */
235 if (vma->vm_file &&
236 gfp_zone(mapping_gfp_mask(vma->vm_file->f_mapping))
237 < policy_zone)
238 return 0;
239 return 1;
240}
241
223#else 242#else
224 243
225struct mempolicy {}; 244struct mempolicy {};