提交 e56c6e5c 编写于 作者: J Jian Zhang

memcontrol: Add oom recover for kmemcg when release buddy hugepage

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

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

In Ascend, we use tmp hugepage and disable OOM-killer, when we cause a OOM,
and after some time, the memory is enough for process, the process will not
return to run normal. In this case, we must use oom recover to let the
process run.
Signed-off-by: NJian Zhang <zhangjian210@huawei.com>
上级 a5a6aebf
...@@ -3116,12 +3116,23 @@ void __memcg_kmem_uncharge_page(struct page *page, int order) ...@@ -3116,12 +3116,23 @@ void __memcg_kmem_uncharge_page(struct page *page, int order)
{ {
struct obj_cgroup *objcg; struct obj_cgroup *objcg;
unsigned int nr_pages = 1 << order; unsigned int nr_pages = 1 << order;
#ifdef CONFIG_ASCEND_FEATURES
struct mem_cgroup *memcg;
#endif
if (!PageMemcgKmem(page)) if (!PageMemcgKmem(page))
return; return;
objcg = __page_objcg(page); objcg = __page_objcg(page);
obj_cgroup_uncharge_pages(objcg, nr_pages); obj_cgroup_uncharge_pages(objcg, nr_pages);
#ifdef CONFIG_ASCEND_FEATURES
memcg = get_mem_cgroup_from_objcg(objcg);
if (!mem_cgroup_is_root(memcg))
memcg_oom_recover(memcg);
css_put(&memcg->css);
#endif
page->memcg_data = 0; page->memcg_data = 0;
obj_cgroup_put(objcg); obj_cgroup_put(objcg);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册