提交 db1d159b 编写于 作者: W Weilong Chen 提交者: Yang Yingliang

arm64/ascend: Add hugepage flags change interface

ascend inclusion
category: feature
bugzilla: NA
CVE: NA

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

Add a variable to change alloc hugepage gfp flags, and export it out.
Hugepage need to be accounted by cgroup. We use this to set ACCOUNT
flag to memory subsystem.
Signed-off-by: NWeilong Chen <chenweilong@huawei.com>
Reviewed-by: NDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 b6bcd500
...@@ -1471,6 +1471,10 @@ static struct page *alloc_fresh_huge_page(struct hstate *h, ...@@ -1471,6 +1471,10 @@ static struct page *alloc_fresh_huge_page(struct hstate *h,
return page; return page;
} }
#ifdef CONFIG_ASCEND_AUTO_TUNING_HUGEPAGE
gfp_t hugepage_gfp_mask = 0;
EXPORT_SYMBOL(hugepage_gfp_mask);
#endif
/* /*
* Allocates a fresh page to the hugetlb allocator pool in the node interleaved * Allocates a fresh page to the hugetlb allocator pool in the node interleaved
* manner. * manner.
...@@ -1480,7 +1484,12 @@ static int alloc_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed, ...@@ -1480,7 +1484,12 @@ static int alloc_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed,
{ {
struct page *page; struct page *page;
int nr_nodes, node; int nr_nodes, node;
#ifdef CONFIG_ASCEND_AUTO_TUNING_HUGEPAGE
gfp_t gfp_mask = htlb_alloc_mask(h) | __GFP_THISNODE |
hugepage_gfp_mask;
#else
gfp_t gfp_mask = htlb_alloc_mask(h) | __GFP_THISNODE; gfp_t gfp_mask = htlb_alloc_mask(h) | __GFP_THISNODE;
#endif
for_each_node_mask_to_alloc(h, nr_nodes, node, nodes_allowed) { for_each_node_mask_to_alloc(h, nr_nodes, node, nodes_allowed) {
page = alloc_fresh_huge_page(h, gfp_mask, node, nodes_allowed, page = alloc_fresh_huge_page(h, gfp_mask, node, nodes_allowed,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册