From fee37ed37d01dac99209e563d20d5caa0ce661ec Mon Sep 17 00:00:00 2001 From: Hongchen Zhang Date: Thu, 15 Dec 2022 18:09:15 +0800 Subject: [PATCH] LoongArch: enable hugetlbfs support LoongArch inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I6BWFP -------------------------------- Signed-off-by: Hongchen Zhang Change-Id: I4631175847064093af8f143d0c46b267a82de069 (cherry picked from commit f3f1f3b964ea4d9daffb10564cd6b867239ebca1) --- arch/loongarch/Kconfig | 3 +++ arch/loongarch/configs/loongson3_defconfig | 1 + arch/loongarch/mm/hugetlbpage.c | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index 7ff49eba631b..0436e79e3928 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -497,6 +497,9 @@ config ARCH_SPARSEMEM_ENABLE or have huge holes in the physical address space for other reasons. See for more. +config SYS_SUPPORTS_HUGETLBFS + def_bool y + config ARCH_ENABLE_THP_MIGRATION def_bool y depends on TRANSPARENT_HUGEPAGE diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig index def76987a4c5..8e15593b052a 100644 --- a/arch/loongarch/configs/loongson3_defconfig +++ b/arch/loongarch/configs/loongson3_defconfig @@ -733,6 +733,7 @@ CONFIG_FAT_DEFAULT_IOCHARSET="gb2312" CONFIG_PROC_KCORE=y CONFIG_TMPFS=y CONFIG_TMPFS_POSIX_ACL=y +CONFIG_HUGETLBFS=y CONFIG_CONFIGFS_FS=y CONFIG_HFS_FS=m CONFIG_HFSPLUS_FS=m diff --git a/arch/loongarch/mm/hugetlbpage.c b/arch/loongarch/mm/hugetlbpage.c index ba138117b124..97ed6f1d1c9b 100644 --- a/arch/loongarch/mm/hugetlbpage.c +++ b/arch/loongarch/mm/hugetlbpage.c @@ -13,8 +13,8 @@ #include #include -pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, - unsigned long addr, unsigned long sz) +pte_t *huge_pte_alloc(struct mm_struct *mm, + unsigned long addr, unsigned long sz) { pgd_t *pgd; p4d_t *p4d; -- GitLab