aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/migrate.h
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2012-11-19 07:35:47 -0500
committerMel Gorman <mgorman@suse.de>2012-12-11 09:42:57 -0500
commitb32967ff101a7508f70be8de59b278d4df92fa00 (patch)
treeb106d5eea06f97d0174f483d6a05a8b7ddd64154 /include/linux/migrate.h
parent5bca23035391928c4c7301835accca3551b96cc2 (diff)
mm: numa: Add THP migration for the NUMA working set scanning fault case.
Note: This is very heavily based on a patch from Peter Zijlstra with fixes from Ingo Molnar, Hugh Dickins and Johannes Weiner. That patch put a lot of migration logic into mm/huge_memory.c where it does not belong. This version puts tries to share some of the migration logic with migrate_misplaced_page. However, it should be noted that now migrate.c is doing more with the pagetable manipulation than is preferred. The end result is barely recognisable so as before, the signed-offs had to be removed but will be re-added if the original authors are ok with it. Add THP migration for the NUMA working set scanning fault case. It uses the page lock to serialize. No migration pte dance is necessary because the pte is already unmapped when we decide to migrate. [dhillf@gmail.com: Fix memory leak on isolation failure] [dhillf@gmail.com: Fix transfer of last_nid information] Signed-off-by: Mel Gorman <mgorman@suse.de>
Diffstat (limited to 'include/linux/migrate.h')
-rw-r--r--include/linux/migrate.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 91556889adac..51eac4bdc606 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -79,6 +79,12 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
79extern int migrate_misplaced_page(struct page *page, int node); 79extern int migrate_misplaced_page(struct page *page, int node);
80extern int migrate_misplaced_page(struct page *page, int node); 80extern int migrate_misplaced_page(struct page *page, int node);
81extern bool migrate_ratelimited(int node); 81extern bool migrate_ratelimited(int node);
82extern int migrate_misplaced_transhuge_page(struct mm_struct *mm,
83 struct vm_area_struct *vma,
84 pmd_t *pmd, pmd_t entry,
85 unsigned long address,
86 struct page *page, int node);
87
82#else 88#else
83static inline int migrate_misplaced_page(struct page *page, int node) 89static inline int migrate_misplaced_page(struct page *page, int node)
84{ 90{
@@ -88,6 +94,15 @@ static inline bool migrate_ratelimited(int node)
88{ 94{
89 return false; 95 return false;
90} 96}
97
98static inline int migrate_misplaced_transhuge_page(struct mm_struct *mm,
99 struct vm_area_struct *vma,
100 pmd_t *pmd, pmd_t entry,
101 unsigned long address,
102 struct page *page, int node)
103{
104 return -EAGAIN;
105}
91#endif /* CONFIG_NUMA_BALANCING */ 106#endif /* CONFIG_NUMA_BALANCING */
92 107
93#endif /* _LINUX_MIGRATE_H */ 108#endif /* _LINUX_MIGRATE_H */