
From: Zhou Guanghui <zhouguanghui1@huawei.com> Signed-off-by: Zhou Guanghui <zhouguanghui1@huawei.com> Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com> Reviewed-by: Weilong Chen <chenweilong@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 cf4bc7d6dab6..fdf2df965ecf 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2107,6 +2107,13 @@ config ASCEND_SVSP Therefore, in the sva scenario, an svsp is created for each target process address space. +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 9bfb781fafd3..ca74653bb5f8 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4847,7 +4847,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; -- 2.17.1