linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [BUGFIX][PATCH] memcg: fix oom killer kills a task in other cgroup
@ 2010-02-05  0:39 KAMEZAWA Hiroyuki
  2010-02-05  0:57 ` David Rientjes
  2010-02-05 16:30 ` Minchan Kim
  0 siblings, 2 replies; 19+ messages in thread
From: KAMEZAWA Hiroyuki @ 2010-02-05  0:39 UTC (permalink / raw)
  To: linux-mm@kvack.org
  Cc: balbir@linux.vnet.ibm.com, nishimura@mxp.nes.nec.co.jp,
	akpm@linux-foundation.org, rientjes

Please take this patch in different context with recent discussion.
This is a quick-fix for a terrible bug.

This patch itself is against mmotm but can be easily applied to mainline or
stable tree, I think. (But I don't CC stable tree until I get ack.)

==
Now, oom-killer kills process's chidlren at first. But this means
a child in other cgroup can be killed. But it's not checked now.

This patch fixes that.

CC: Balbir Singh <balbir@linux.vnet.ibm.com>
CC: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
 mm/oom_kill.c |    3 +++
 1 file changed, 3 insertions(+)

Index: mmotm-2.6.33-Feb03/mm/oom_kill.c
===================================================================
--- mmotm-2.6.33-Feb03.orig/mm/oom_kill.c
+++ mmotm-2.6.33-Feb03/mm/oom_kill.c
@@ -459,6 +459,9 @@ static int oom_kill_process(struct task_
 	list_for_each_entry(c, &p->children, sibling) {
 		if (c->mm == p->mm)
 			continue;
+		/* Children may be in other cgroup */
+		if (mem && !task_in_mem_cgroup(c, mem))
+			continue;
 		if (!oom_kill_task(c))
 			return 0;
 	}

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2010-02-09 10:18 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-05  0:39 [BUGFIX][PATCH] memcg: fix oom killer kills a task in other cgroup KAMEZAWA Hiroyuki
2010-02-05  0:57 ` David Rientjes
2010-02-05 16:30 ` Minchan Kim
2010-02-09  0:32   ` KAMEZAWA Hiroyuki
2010-02-09  0:56     ` KAMEZAWA Hiroyuki
2010-02-09  1:24     ` Minchan Kim
2010-02-09  1:34       ` KAMEZAWA Hiroyuki
2010-02-09  6:49       ` David Rientjes
2010-02-09  7:08         ` KAMEZAWA Hiroyuki
2010-02-09  9:40         ` Minchan Kim
2010-02-09  9:55           ` David Rientjes
2010-02-09 10:18             ` Minchan Kim
2010-02-09  3:02   ` [BUGFIX][PATCH] memcg: fix oom killer kills a task in other cgroup v2 KAMEZAWA Hiroyuki
2010-02-09  7:50     ` David Rientjes
2010-02-09  8:02       ` KAMEZAWA Hiroyuki
2010-02-09  8:21         ` David Rientjes
2010-02-09  9:22           ` KAMEZAWA Hiroyuki
2010-02-09  9:35             ` David Rientjes
2010-02-09  9:27     ` Balbir Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).