diff options
author | Mel Gorman <mgorman@suse.de> | 2012-12-05 04:32:56 -0500 |
---|---|---|
committer | Mel Gorman <mgorman@suse.de> | 2012-12-11 09:42:58 -0500 |
commit | 220018d388b8ab1fca1c5f0c6474bab47ad2c9c0 (patch) | |
tree | 46c6a2784fb5dc0e35110b7cc7455add77eaf056 | |
parent | b32967ff101a7508f70be8de59b278d4df92fa00 (diff) |
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>
-rw-r--r-- | include/linux/migrate.h | 16 | ||||
-rw-r--r-- | mm/migrate.c | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 51eac4bdc606..d52afb9a790c 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -79,12 +79,6 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping, | |||
79 | extern int migrate_misplaced_page(struct page *page, int node); | 79 | extern int migrate_misplaced_page(struct page *page, int node); |
80 | 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); | 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 | #else | 82 | #else |
89 | static inline int migrate_misplaced_page(struct page *page, int node) | 83 | static inline int migrate_misplaced_page(struct page *page, int node) |
90 | { | 84 | { |
@@ -94,7 +88,15 @@ static inline bool migrate_ratelimited(int node) | |||
94 | { | 88 | { |
95 | return false; | 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 | static inline int migrate_misplaced_transhuge_page(struct mm_struct *mm, | 100 | static inline int migrate_misplaced_transhuge_page(struct mm_struct *mm, |
99 | struct vm_area_struct *vma, | 101 | struct vm_area_struct *vma, |
100 | pmd_t *pmd, pmd_t entry, | 102 | pmd_t *pmd, pmd_t entry, |
@@ -103,6 +105,6 @@ static inline int migrate_misplaced_transhuge_page(struct mm_struct *mm, | |||
103 | { | 105 | { |
104 | return -EAGAIN; | 106 | return -EAGAIN; |
105 | } | 107 | } |
106 | #endif /* CONFIG_NUMA_BALANCING */ | 108 | #endif /* CONFIG_NUMA_BALANCING && CONFIG_TRANSPARENT_HUGEPAGE*/ |
107 | 109 | ||
108 | #endif /* _LINUX_MIGRATE_H */ | 110 | #endif /* _LINUX_MIGRATE_H */ |
diff --git a/mm/migrate.c b/mm/migrate.c index c9400960fd52..9341a501d168 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -1602,7 +1602,9 @@ int migrate_misplaced_page(struct page *page, int node) | |||
1602 | out: | 1602 | out: |
1603 | return isolated; | 1603 | return isolated; |
1604 | } | 1604 | } |
1605 | #endif /* CONFIG_NUMA_BALANCING */ | ||
1605 | 1606 | ||
1607 | #if defined(CONFIG_NUMA_BALANCING) && defined(CONFIG_TRANSPARENT_HUGEPAGE) | ||
1606 | int migrate_misplaced_transhuge_page(struct mm_struct *mm, | 1608 | int migrate_misplaced_transhuge_page(struct mm_struct *mm, |
1607 | struct vm_area_struct *vma, | 1609 | struct vm_area_struct *vma, |
1608 | pmd_t *pmd, pmd_t entry, | 1610 | pmd_t *pmd, pmd_t entry, |