From: Zhou Guanghui zhouguanghui1@huawei.com
Offering: HULK hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I7SZC2
-------------------------------------
Add support for disable clear hugepage.
Signed-off-by: Zhou Guanghui zhouguanghui1@huawei.com Signed-off-by: Zhang Zekun zhangzekun11@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 30c747321b8e..5d3168f273bf 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -2119,6 +2119,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 1cf0a61831e4..229b4170d1cd 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4906,7 +4906,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;