Commit 220018d388b8ab1fca1c5f0c6474bab47ad2c9c0

Authored by Mel Gorman
1 parent b32967ff10

mm: numa: Add THP migration for the NUMA working set scanning fault case build fix

Commit "Add THP migration for the NUMA working set scanning fault case"
breaks the build because HPAGE_PMD_SHIFT and HPAGE_PMD_MASK defined to
explode without CONFIG_TRANSPARENT_HUGEPAGE:

mm/migrate.c: In function 'migrate_misplaced_transhuge_page_put':
mm/migrate.c:1549: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed
mm/migrate.c:1564: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed
mm/migrate.c:1566: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed
mm/migrate.c:1573: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed
mm/migrate.c:1606: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed
mm/migrate.c:1648: error: call to '__build_bug_failed' declared with attribute error: BUILD_BUG failed

CONFIG_NUMA_BALANCING allows compilation without enabling transparent
hugepages, so define the dummy function for such a configuration and only
define migrate_misplaced_transhuge_page_put() when transparent hugepages
are enabled.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>

Showing 2 changed files with 11 additions and 7 deletions Side-by-side Diff

include/linux/migrate.h
... ... @@ -79,12 +79,6 @@
79 79 extern int migrate_misplaced_page(struct page *page, int node);
80 80 extern int migrate_misplaced_page(struct page *page, int node);
81 81 extern bool migrate_ratelimited(int node);
82   -extern 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   -
88 82 #else
89 83 static inline int migrate_misplaced_page(struct page *page, int node)
90 84 {
91 85  
... ... @@ -94,7 +88,15 @@
94 88 {
95 89 return false;
96 90 }
  91 +#endif /* CONFIG_NUMA_BALANCING */
97 92  
  93 +#if defined(CONFIG_NUMA_BALANCING) && defined(CONFIG_TRANSPARENT_HUGEPAGE)
  94 +extern int migrate_misplaced_transhuge_page(struct mm_struct *mm,
  95 + struct vm_area_struct *vma,
  96 + pmd_t *pmd, pmd_t entry,
  97 + unsigned long address,
  98 + struct page *page, int node);
  99 +#else
98 100 static inline int migrate_misplaced_transhuge_page(struct mm_struct *mm,
99 101 struct vm_area_struct *vma,
100 102 pmd_t *pmd, pmd_t entry,
... ... @@ -103,7 +105,7 @@
103 105 {
104 106 return -EAGAIN;
105 107 }
106   -#endif /* CONFIG_NUMA_BALANCING */
  108 +#endif /* CONFIG_NUMA_BALANCING && CONFIG_TRANSPARENT_HUGEPAGE*/
107 109  
108 110 #endif /* _LINUX_MIGRATE_H */
... ... @@ -1602,7 +1602,9 @@
1602 1602 out:
1603 1603 return isolated;
1604 1604 }
  1605 +#endif /* CONFIG_NUMA_BALANCING */
1605 1606  
  1607 +#if defined(CONFIG_NUMA_BALANCING) && defined(CONFIG_TRANSPARENT_HUGEPAGE)
1606 1608 int migrate_misplaced_transhuge_page(struct mm_struct *mm,
1607 1609 struct vm_area_struct *vma,
1608 1610 pmd_t *pmd, pmd_t entry,