From: Liu Shixin liushixin2@huawei.com
hulk inclusion category: feature bugzilla: 46904, https://gitee.com/openeuler/kernel/issues/I4QSHG CVE: NA
--------------------------------
The dynamic_hugetlb feature need to split and merge pages frequently. hugetlb_vmemmap will affects the perforemance of page split and merge. If want to use dynamic hugetlb, please disable hugetlb_vmemmap.
Signed-off-by: Liu Shixin liushixin2@huawei.com Reviewed-by: Kefeng Wang wangkefeng.wang@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- mm/dynamic_hugetlb.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/mm/dynamic_hugetlb.c b/mm/dynamic_hugetlb.c index e9f5348bcccd..f20e654cc856 100644 --- a/mm/dynamic_hugetlb.c +++ b/mm/dynamic_hugetlb.c @@ -1081,6 +1081,17 @@ void __init dynamic_hugetlb_init(void) if (!enable_dhugetlb) return;
+ /* + * The dynamic_hugetlb feature need to split and merge pages frequently. + * hugetlb_vmemmap will affects the perforemance of page split and merge. + * If want to use dynamic hugetlb, please disable hugetlb_vmemmap. + */ + if (hugetlb_free_vmemmap_enabled) { + enable_dhugetlb = false; + pr_info("Please set hugetlb_free_vmemmap=off if want to enable dynamic hugetlb\n"); + return; + } + count = max(hugepage_index(max_pfn), (unsigned long)DEFAULT_PAGELIST_COUNT); size = sizeof(struct dhugetlb_pagelist) + count * sizeof(struct dhugetlb_pool *); dhugetlb_pagelist_t = kzalloc(size, GFP_KERNEL);