[lkml]   [2010]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[008/145] memcg: fix oom killing a child process in an other cgroup
2.6.32-stable review patch.  If anyone has any objections, please let me know.

From: KAMEZAWA Hiroyuki <>

commit 5a2d41961dd6815b874b5c0afec0ac96cd90eea4 upstream.

Presently the oom-killer is memcg aware and it finds the worst process
from processes under memcg(s) in oom. Then, it kills victim's child

It may kill a child in another cgroup and may not be any help for
recovery. And it will break the assumption users have.

This patch fixes it.

Signed-off-by: KAMEZAWA Hiroyuki <>
Reviewed-by: Minchan Kim <>
Cc: Balbir Singh <>
Reviewed-by: Daisuke Nishimura <>
Acked-by: David Rientjes <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
Signed-off-by: Greg Kroah-Hartman <>

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

--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -426,6 +426,8 @@ static int oom_kill_process(struct task_
list_for_each_entry(c, &p->children, sibling) {
if (c->mm == p->mm)
+ if (mem && !task_in_mem_cgroup(c, mem))
+ continue;
if (!oom_kill_task(c))
return 0;

 \ /
  Last update: 2010-03-13 01:33    [W:0.309 / U:42.608 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site