lkml.org 
[lkml]   [2010]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[BUGFIX][PATCH] memcg: fix oom killing a child process in an other cgroup
This patch itself is againt mmotm-Feb10 but can be applied to 2.6.32.8
without problem.

==
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

Now, oom-killer is memcg aware and it finds the worst process from
processes under memcg(s) in oom. Then, it kills victim's child at first.
It may kill a child in other cgroup and may not be any help for recovery.
And it will break the assumption users have...

This patch fixes it.

CC: stable@kernel.org
CC: Minchan Kim <minchan.kim@gmail.com>
CC: Balbir Singh <balbir@linux.vnet.ibm.com>
CC: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

---
mm/oom_kill.c | 2 ++
1 file changed, 2 insertions(+)

Index: mmotm-2.6.33-Feb10/mm/oom_kill.c
===================================================================
--- mmotm-2.6.33-Feb10.orig/mm/oom_kill.c
+++ mmotm-2.6.33-Feb10/mm/oom_kill.c
@@ -459,6 +459,8 @@ static int oom_kill_process(struct task_
list_for_each_entry(c, &p->children, sibling) {
if (c->mm == p->mm)
continue;
+ if (mem && !task_in_mem_cgroup(c, mem))
+ continue;
if (!oom_kill_task(c))
return 0;
}


\
 
 \ /
  Last update: 2010-02-12 02:59    [W:0.029 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site