diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2013-06-12 17:05:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-12 19:29:46 -0400 |
commit | 30dad30922ccc733cfdbfe232090cf674dc374dc (patch) | |
tree | 7663089f93435ea0c298eb69058ca834c109f530 /include/linux | |
parent | 27749f2ff0717e115680922000839ad6a576eddf (diff) |
mm: migration: add migrate_entry_wait_huge()
When we have a page fault for the address which is backed by a hugepage
under migration, the kernel can't wait correctly and do busy looping on
hugepage fault until the migration finishes. As a result, users who try
to kick hugepage migration (via soft offlining, for example) occasionally
experience long delay or soft lockup.
This is because pte_offset_map_lock() can't get a correct migration entry
or a correct page table lock for hugepage. This patch introduces
migration_entry_wait_huge() to solve this.
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: <stable@vger.kernel.org> [2.6.35+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/swapops.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index 47ead515c811..c5fd30d2a415 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -137,6 +137,7 @@ static inline void make_migration_entry_read(swp_entry_t *entry) | |||
137 | 137 | ||
138 | extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | 138 | extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, |
139 | unsigned long address); | 139 | unsigned long address); |
140 | extern void migration_entry_wait_huge(struct mm_struct *mm, pte_t *pte); | ||
140 | #else | 141 | #else |
141 | 142 | ||
142 | #define make_migration_entry(page, write) swp_entry(0, 0) | 143 | #define make_migration_entry(page, write) swp_entry(0, 0) |
@@ -148,6 +149,8 @@ static inline int is_migration_entry(swp_entry_t swp) | |||
148 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } | 149 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } |
149 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | 150 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, |
150 | unsigned long address) { } | 151 | unsigned long address) { } |
152 | static inline void migration_entry_wait_huge(struct mm_struct *mm, | ||
153 | pte_t *pte) { } | ||
151 | static inline int is_write_migration_entry(swp_entry_t entry) | 154 | static inline int is_write_migration_entry(swp_entry_t entry) |
152 | { | 155 | { |
153 | return 0; | 156 | return 0; |