提交 f15774c6 编写于 作者: L Liu Shixin 提交者: Yongqiang Liu

dhugetlb: only support 1G/2M hugepage and ARM64_4K_PAGES

hulk inclusion
category: feature
bugzilla: 46904, https://gitee.com/openeuler/kernel/issues/I6BDME
CVE: NA

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

For now, we only support 1G and 2M hugepage on arm64 with 4K pages.
So restrict the config depends on ARM64_4K_PAGES and only setting hpool
for 1G and 2M hugepage.
Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
上级 1cca8ee5
...@@ -216,6 +216,7 @@ config DYNAMIC_HUGETLB ...@@ -216,6 +216,7 @@ config DYNAMIC_HUGETLB
depends on HUGETLB_PAGE depends on HUGETLB_PAGE
depends on MEMCG depends on MEMCG
depends on CGROUP_HUGETLB depends on CGROUP_HUGETLB
depends on X86_64 || (ARM64 && ARM64_4K_PAGES)
help help
Dynamic hugepage are used in memcg and can be splited into small pages Dynamic hugepage are used in memcg and can be splited into small pages
automatically. The tasks in the memcg prefer to alloc dynamic hugepage. automatically. The tasks in the memcg prefer to alloc dynamic hugepage.
......
...@@ -1166,7 +1166,9 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb) ...@@ -1166,7 +1166,9 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb)
mpol_shared_policy_init(&p->policy, NULL); mpol_shared_policy_init(&p->policy, NULL);
#ifdef CONFIG_DYNAMIC_HUGETLB #ifdef CONFIG_DYNAMIC_HUGETLB
/* Initialize hpool here in case of a quick call to destroy */ /* Initialize hpool here in case of a quick call to destroy */
p->hpool = get_dhugetlb_pool_from_task(current); if (huge_page_size(sbinfo->hstate) == PMD_SIZE ||
huge_page_size(sbinfo->hstate) == PUD_SIZE)
p->hpool = get_dhugetlb_pool_from_task(current);
#endif #endif
return &p->vfs_inode; return &p->vfs_inode;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册