aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/hugetlbpage.c
diff options
context:
space:
mode:
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>2013-09-11 17:22:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:57:49 -0400
commit83467efbdb7948146581a56cbd683a22a0684bbb (patch)
tree8faaf4d713adcfd5875190ee23f0218212838f24 /arch/x86/mm/hugetlbpage.c
parentc8721bbbdd36382de51cd6b7a56322e0acca2414 (diff)
mm: migrate: check movability of hugepage in unmap_and_move_huge_page()
Currently hugepage migration works well only for pmd-based hugepages (mainly due to lack of testing,) so we had better not enable migration of other levels of hugepages until we are ready for it. Some users of hugepage migration (mbind, move_pages, and migrate_pages) do page table walk and check pud/pmd_huge() there, so they are safe. But the other users (softoffline and memory hotremove) don't do this, so without this patch they can try to migrate unexpected types of hugepages. To prevent this, we introduce hugepage_migration_support() as an architecture dependent check of whether hugepage are implemented on a pmd basis or not. And on some architecture multiple sizes of hugepages are available, so hugepage_migration_support() also checks hugepage size. Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Hillf Danton <dhillf@gmail.com> Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Hugh Dickins <hughd@google.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Michal Hocko <mhocko@suse.cz> Cc: Rik van Riel <riel@redhat.com> Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/mm/hugetlbpage.c')
-rw-r--r--arch/x86/mm/hugetlbpage.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c
index 7e73e8c69096..9d980d88b747 100644
--- a/arch/x86/mm/hugetlbpage.c
+++ b/arch/x86/mm/hugetlbpage.c
@@ -59,6 +59,10 @@ follow_huge_pmd(struct mm_struct *mm, unsigned long address,
59 return NULL; 59 return NULL;
60} 60}
61 61
62int pmd_huge_support(void)
63{
64 return 0;
65}
62#else 66#else
63 67
64struct page * 68struct page *
@@ -77,6 +81,10 @@ int pud_huge(pud_t pud)
77 return !!(pud_val(pud) & _PAGE_PSE); 81 return !!(pud_val(pud) & _PAGE_PSE);
78} 82}
79 83
84int pmd_huge_support(void)
85{
86 return 1;
87}
80#endif 88#endif
81 89
82/* x86_64 also uses this file */ 90/* x86_64 also uses this file */