提交 d1b76502 编写于 作者: W Wang Wensheng 提交者: Zheng Zengkai

share_pool: charge pages to the memcg of current task

ascend inclusion
category: Feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4NDAW
CVE: NA

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

In the share pool scenario, when the shared memory is applied
for, the do_mm_populate function is performed at the same time,
that is, the corresponding pages are allocated. In the current
share pool implementation, the memory is charged to the memcg of
the first task added to this share pool group.

This is unreasonable and may cause memcg of first task oom.
So, we should charge the pages to the memcg of current task.
Signed-off-by: NZhou Guanghui <zhouguanghui1@huawei.com>
Signed-off-by: NWang Wensheng <wangwensheng4@huawei.com>
Reviewed-by: Kefeng Wang<wangkefeng.wang@huawei.com>
Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 07c6aec3
......@@ -1819,7 +1819,7 @@ static int shmem_getpage_gfp(struct inode *inode, pgoff_t index,
}
sbinfo = SHMEM_SB(inode->i_sb);
charge_mm = vma ? vma->vm_mm : current->mm;
charge_mm = vma && !sp_check_vm_share_pool(vma->vm_flags) ? vma->vm_mm : current->mm;
page = pagecache_get_page(mapping, index,
FGP_ENTRY | FGP_HEAD | FGP_LOCK, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册