提交 3f3eaf96 编写于 作者: L Liu Shixin 提交者: Zheng Zengkai

mm/dynamic_hugetlb: only support to merge 2M dynamicly

hulk inclusion
category: bugfix
bugzilla: 46904 https://gitee.com/openeuler/kernel/issues/I4Y0XO

--------------------------------

We do not support dynamic combination of 1G hugepages dynamicly as this can
result in a significant performance loss. We suggest to configure the number of
hugepages immediately after creating a dynamic hugetlb pool rather than modify
them dynamicly while some processes are runing.
Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 687fb2b1
......@@ -938,17 +938,20 @@ static ssize_t update_reserved_pages(struct mem_cgroup *memcg, char *buf, int hp
if (hpool_split_page(hpool, hpages_pool_idx - 1))
break;
}
/*
* First try to merge pages without migration, If this can not meet
* the requirements, then try to merge pages with migration.
*/
while (delta > hpages_pool->free_normal_pages) {
if (hpool_merge_page(hpool, hpages_pool_idx, false))
break;
}
while (delta > hpages_pool->free_normal_pages) {
if (hpool_merge_page(hpool, hpages_pool_idx, true))
break;
/* Currently, only merging 2M hugepages is supported */
if (hpages_pool_idx == HUGE_PAGES_POOL_2M) {
/*
* First try to merge pages without migration, If this can not meet
* the requirements, then try to merge pages with migration.
*/
while (delta > hpages_pool->free_normal_pages) {
if (hpool_merge_page(hpool, hpages_pool_idx, false))
break;
}
while (delta > hpages_pool->free_normal_pages) {
if (hpool_merge_page(hpool, hpages_pool_idx, true))
break;
}
}
delta = min(nr_pages - hpages_pool->nr_huge_pages, hpages_pool->free_normal_pages);
hpages_pool->nr_huge_pages += delta;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册