From: Zhou Guanghui zhouguanghui1@huawei.com
Signed-off-by: Zhou Guanghui zhouguanghui1@huawei.com --- arch/arm64/Kconfig | 7 +++++++ mm/hugetlb.c | 2 ++ 2 files changed, 9 insertions(+)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index c6aa794901e1..91175d4d2806 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2092,6 +2092,13 @@ config ASCEND_SHARE_POOL This feature allows multiple processes to share virtual memory both in kernel and user level, which is only enabled for ascend platform.
+config ASCEND_CLEAR_HUGEPAGE_DISABLE + bool "Disable clear hugepage" + default n + help + Disable clear hugepage when alloc hugepages to improve the hugepage + application performance. + endif
endmenu diff --git a/mm/hugetlb.c b/mm/hugetlb.c index de47c996ee67..9556bf2d9b45 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4763,7 +4763,9 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, ret = vmf_error(PTR_ERR(page)); goto out; } +#ifndef CONFIG_ASCEND_CLEAR_HUGEPAGE_DISABLE clear_huge_page(page, address, pages_per_huge_page(h)); +#endif __SetPageUptodate(page); new_page = true;