From: Jian Zhang zhangjian210@huawei.com
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: Jian Zhang zhangjian210@huawei.com --- mm/memcontrol.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a3617f0a0fd1..b2c4bc4bb591 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3116,12 +3116,23 @@ void __memcg_kmem_uncharge_page(struct page *page, int order) { struct obj_cgroup *objcg; unsigned int nr_pages = 1 << order; +#ifdef CONFIG_ASCEND_FEATURES + struct mem_cgroup *memcg; +#endif
if (!PageMemcgKmem(page)) return;
objcg = __page_objcg(page); 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; obj_cgroup_put(objcg); }