1 #ifndef _LINUX_MIGRATE_H
2 #define _LINUX_MIGRATE_H
5 #include <linux/mempolicy.h>
6 #include <linux/migrate_mode.h>
8 typedef struct page *new_page_t(struct page *, unsigned long private, int **);
14 MR_SYSCALL, /* also applies to cpusets */
20 #ifdef CONFIG_MIGRATION
22 extern void putback_lru_pages(struct list_head *l);
23 extern int migrate_page(struct address_space *,
24 struct page *, struct page *, enum migrate_mode);
25 extern int migrate_pages(struct list_head *l, new_page_t x,
26 unsigned long private, bool offlining,
27 enum migrate_mode mode, int reason);
28 extern int migrate_huge_page(struct page *, new_page_t x,
29 unsigned long private, bool offlining,
30 enum migrate_mode mode);
32 extern int fail_migrate_page(struct address_space *,
33 struct page *, struct page *);
35 extern int migrate_prep(void);
36 extern int migrate_prep_local(void);
37 extern int migrate_vmas(struct mm_struct *mm,
38 const nodemask_t *from, const nodemask_t *to,
40 extern void migrate_page_copy(struct page *newpage, struct page *page);
41 extern int migrate_huge_page_move_mapping(struct address_space *mapping,
42 struct page *newpage, struct page *page);
45 static inline void putback_lru_pages(struct list_head *l) {}
46 static inline int migrate_pages(struct list_head *l, new_page_t x,
47 unsigned long private, bool offlining,
48 enum migrate_mode mode, int reason) { return -ENOSYS; }
49 static inline int migrate_huge_page(struct page *page, new_page_t x,
50 unsigned long private, bool offlining,
51 enum migrate_mode mode) { return -ENOSYS; }
53 static inline int migrate_prep(void) { return -ENOSYS; }
54 static inline int migrate_prep_local(void) { return -ENOSYS; }
56 static inline int migrate_vmas(struct mm_struct *mm,
57 const nodemask_t *from, const nodemask_t *to,
63 static inline void migrate_page_copy(struct page *newpage,
66 static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
67 struct page *newpage, struct page *page)
72 /* Possible settings for the migrate_page() method in address_operations */
73 #define migrate_page NULL
74 #define fail_migrate_page NULL
76 #endif /* CONFIG_MIGRATION */
78 #ifdef CONFIG_NUMA_BALANCING
79 extern int migrate_misplaced_page(struct page *page, int node);
80 extern int migrate_misplaced_page(struct page *page, int node);
81 extern bool migrate_ratelimited(int node);
83 static inline int migrate_misplaced_page(struct page *page, int node)
85 return -EAGAIN; /* can't migrate now */
87 static inline bool migrate_ratelimited(int node)
91 #endif /* CONFIG_NUMA_BALANCING */
93 #endif /* _LINUX_MIGRATE_H */