提交 c3c8bbec 编写于 作者: T Tang Yizhou 提交者: Yang Yingliang

share_pool: Don't do direct reclaim or compact for vmalloc_huge* funcs

ascend inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4EUVI
CVE: NA

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

We found a hungtask problem when do direct compact in
__alloc_pages_nodemask:

vmalloc_hugepage_user -> __vmalloc_node_range -> __vmalloc_area_node ->
sp_alloc_pages -> alloc_huge_page_node -> alloc_fresh_huge_page ->
__alloc_pages_nodemask.

Set PF_MEMALLOC then direct reclaim and direct compact won't be called.
Signed-off-by: NTang Yizhou <tangyizhou@huawei.com>
Reviewed-by: NDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 bf95ee84
......@@ -3219,9 +3219,15 @@ void sp_group_post_exit(struct mm_struct *mm)
struct page *sp_alloc_pages(struct vm_struct *area, gfp_t mask,
unsigned int page_order, int node)
{
if (area->flags & VM_HUGE_PAGES)
return hugetlb_alloc_hugepage(NUMA_NO_NODE, HUGETLB_ALLOC_NONE);
else
struct page *page;
unsigned int noreclaim_flag = 0;
if (area->flags & VM_HUGE_PAGES) {
noreclaim_flag = memalloc_noreclaim_save();
page = hugetlb_alloc_hugepage(NUMA_NO_NODE, HUGETLB_ALLOC_NONE);
memalloc_noreclaim_restore(noreclaim_flag);
return page;
} else
return alloc_pages_node(node, mask, page_order);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册