Skip to content

Commit 9c670ea

Browse files
Naoya Horiguchitorvalds
authored andcommitted
mm: thp: introduce CONFIG_ARCH_ENABLE_THP_MIGRATION
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]>
1 parent b5ff816 commit 9c670ea

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

arch/x86/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,6 +2343,10 @@ config ARCH_ENABLE_HUGEPAGE_MIGRATION
23432343
def_bool y
23442344
depends on X86_64 && HUGETLB_PAGE && MIGRATION
23452345

2346+
config ARCH_ENABLE_THP_MIGRATION
2347+
def_bool y
2348+
depends on X86_64 && TRANSPARENT_HUGEPAGE
2349+
23462350
menu "Power management and ACPI options"
23472351

23482352
config ARCH_HIBERNATION_HEADER

include/linux/huge_mm.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ void mm_put_huge_zero_page(struct mm_struct *mm);
233233

234234
#define mk_huge_pmd(page, prot) pmd_mkhuge(mk_pmd(page, prot))
235235

236+
static inline bool thp_migration_supported(void)
237+
{
238+
return IS_ENABLED(CONFIG_ARCH_ENABLE_THP_MIGRATION);
239+
}
240+
236241
#else /* CONFIG_TRANSPARENT_HUGEPAGE */
237242
#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
238243
#define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })
@@ -336,6 +341,11 @@ static inline struct page *follow_devmap_pud(struct vm_area_struct *vma,
336341
{
337342
return NULL;
338343
}
344+
345+
static inline bool thp_migration_supported(void)
346+
{
347+
return false;
348+
}
339349
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
340350

341351
#endif /* _LINUX_HUGE_MM_H */

mm/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ config MIGRATION
262262
config ARCH_ENABLE_HUGEPAGE_MIGRATION
263263
bool
264264

265+
config ARCH_ENABLE_THP_MIGRATION
266+
bool
267+
265268
config PHYS_ADDR_T_64BIT
266269
def_bool 64BIT || ARCH_PHYS_ADDR_T_64BIT
267270

0 commit comments

Comments
 (0)