Skip to content

Commit 5480280

Browse files
Anshuman Khandualtorvalds
authored andcommitted
arm64/mm: enable HugeTLB migration for contiguous bit HugeTLB pages
Let arm64 subscribe to the previously added framework in which architecture can inform whether a given huge page size is supported for migration. This just overrides the default function arch_hugetlb_migration_supported() and enables migration for all possible HugeTLB page sizes on arm64. With this, HugeTLB migration support on arm64 now covers all possible HugeTLB options. CONT PTE PMD CONT PMD PUD -------- --- -------- --- 4K: 64K 2M 32M 1G 16K: 2M 32M 1G 64K: 2M 512M 16G Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Anshuman Khandual <[email protected]> Reviewed-by: Naoya Horiguchi <[email protected]> Reviewed-by: Steve Capper <[email protected]> Acked-by: Catalin Marinas <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 4a03a05 commit 5480280

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

arch/arm64/include/asm/hugetlb.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020

2121
#include <asm/page.h>
2222

23+
#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
24+
#define arch_hugetlb_migration_supported arch_hugetlb_migration_supported
25+
extern bool arch_hugetlb_migration_supported(struct hstate *h);
26+
#endif
27+
2328
#define __HAVE_ARCH_HUGE_PTEP_GET
2429
static inline pte_t huge_ptep_get(pte_t *ptep)
2530
{

arch/arm64/mm/hugetlbpage.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,26 @@
2727
#include <asm/tlbflush.h>
2828
#include <asm/pgalloc.h>
2929

30+
#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
31+
bool arch_hugetlb_migration_supported(struct hstate *h)
32+
{
33+
size_t pagesize = huge_page_size(h);
34+
35+
switch (pagesize) {
36+
#ifdef CONFIG_ARM64_4K_PAGES
37+
case PUD_SIZE:
38+
#endif
39+
case PMD_SIZE:
40+
case CONT_PMD_SIZE:
41+
case CONT_PTE_SIZE:
42+
return true;
43+
}
44+
pr_warn("%s: unrecognized huge page size 0x%lx\n",
45+
__func__, pagesize);
46+
return false;
47+
}
48+
#endif
49+
3050
int pmd_huge(pmd_t pmd)
3151
{
3252
return pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT);

0 commit comments

Comments
 (0)