]> Git Repo - linux.git/commitdiff
mm: thp: introduce CONFIG_ARCH_ENABLE_THP_MIGRATION
authorNaoya Horiguchi <[email protected]>
Fri, 8 Sep 2017 23:10:53 +0000 (16:10 -0700)
committerLinus Torvalds <[email protected]>
Sat, 9 Sep 2017 01:26:45 +0000 (18:26 -0700)
Introduce CONFIG_ARCH_ENABLE_THP_MIGRATION to limit thp migration
functionality to x86_64, which should be safer at the first step.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Naoya Horiguchi <[email protected]>
Signed-off-by: Zi Yan <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: David Nellans <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Michal Hocko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
arch/x86/Kconfig
include/linux/huge_mm.h
mm/Kconfig

index 4b278a33ccbb70432c34a1c52588e670f35b5365..07d9b6c75328575d14455877f2100f8ccf55fde6 100644 (file)
@@ -2343,6 +2343,10 @@ config ARCH_ENABLE_HUGEPAGE_MIGRATION
        def_bool y
        depends on X86_64 && HUGETLB_PAGE && MIGRATION
 
+config ARCH_ENABLE_THP_MIGRATION
+       def_bool y
+       depends on X86_64 && TRANSPARENT_HUGEPAGE
+
 menu "Power management and ACPI options"
 
 config ARCH_HIBERNATION_HEADER
index ee696347f928ffc7b0aac51e3c6e1180c11265c9..d8f35a0865dc8573545648244706c4b738af13d0 100644 (file)
@@ -233,6 +233,11 @@ void mm_put_huge_zero_page(struct mm_struct *mm);
 
 #define mk_huge_pmd(page, prot) pmd_mkhuge(mk_pmd(page, prot))
 
+static inline bool thp_migration_supported(void)
+{
+       return IS_ENABLED(CONFIG_ARCH_ENABLE_THP_MIGRATION);
+}
+
 #else /* CONFIG_TRANSPARENT_HUGEPAGE */
 #define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
 #define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })
@@ -336,6 +341,11 @@ static inline struct page *follow_devmap_pud(struct vm_area_struct *vma,
 {
        return NULL;
 }
+
+static inline bool thp_migration_supported(void)
+{
+       return false;
+}
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
 #endif /* _LINUX_HUGE_MM_H */
index 0ded10a22639472daf48453d4f6754fc5a626c4b..9ef8c2ea92ada793a5e9c587b60b44d5c0ef54d8 100644 (file)
@@ -262,6 +262,9 @@ config MIGRATION
 config ARCH_ENABLE_HUGEPAGE_MIGRATION
        bool
 
+config ARCH_ENABLE_THP_MIGRATION
+       bool
+
 config PHYS_ADDR_T_64BIT
        def_bool 64BIT || ARCH_PHYS_ADDR_T_64BIT
 
This page took 0.06268 seconds and 4 git commands to generate.