From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail144.messagelabs.com (mail144.messagelabs.com [216.82.254.51]) by kanga.kvack.org (Postfix) with SMTP id 3119A6B005A for ; Tue, 4 Aug 2009 06:00:38 -0400 (EDT) Received: from m6.gw.fujitsu.co.jp ([10.0.50.76]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id n74ARPq1004114 for (envelope-from kosaki.motohiro@jp.fujitsu.com); Tue, 4 Aug 2009 19:27:26 +0900 Received: from smail (m6 [127.0.0.1]) by outgoing.m6.gw.fujitsu.co.jp (Postfix) with ESMTP id B85FB45DE4F for ; Tue, 4 Aug 2009 19:27:25 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (s6.gw.fujitsu.co.jp [10.0.50.96]) by m6.gw.fujitsu.co.jp (Postfix) with ESMTP id 9DF9245DE4E for ; Tue, 4 Aug 2009 19:27:25 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id 7F0291DB8037 for ; Tue, 4 Aug 2009 19:27:25 +0900 (JST) Received: from m108.s.css.fujitsu.com (m108.s.css.fujitsu.com [10.249.87.108]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id 275101DB8041 for ; Tue, 4 Aug 2009 19:27:22 +0900 (JST) From: KOSAKI Motohiro Subject: [PATCH 3/4] oom: oom_kill doesn't kill vfork parent(or child) In-Reply-To: <20090804191031.6A3D.A69D9226@jp.fujitsu.com> References: <20090804191031.6A3D.A69D9226@jp.fujitsu.com> Message-Id: <20090804192638.6A46.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Tue, 4 Aug 2009 19:27:21 +0900 (JST) Sender: owner-linux-mm@kvack.org To: LKML Cc: kosaki.motohiro@jp.fujitsu.com, Paul Menage , David Rientjes , KAMEZAWA Hiroyuki , Rik van Riel , Andrew Morton , Linus Torvalds , Oleg Nesterov , linux-mm List-ID: Subject: [PATCH] oom: oom_kill doesn't kill vfork parent(or child). Current oom_kill doesn't only kill victim process, but also kill mm shread task. it mean vfork parent will be killed. but, That's bogus. another process have another oom_adj. we shouldn't ignore their oom_adj (it might have OOM_DISABLE). following caller hit the minefield. --------------------------------------- switch (constraint) { case CONSTRAINT_MEMORY_POLICY: oom_kill_process(current, gfp_mask, order, 0, NULL, "No available memory (MPOL_BIND)"); break; Note: force_sig(SIGKILL) send SIGKILL to all thread in the process. We don't need to care multi thread in here. Signed-off-by: KOSAKI Motohiro Cc: Paul Menage Cc: David Rientjes Cc: KAMEZAWA Hiroyuki Cc: Rik van Riel , Cc: Andrew Morton , --- mm/oom_kill.c | 12 ------------ 1 file changed, 12 deletions(-) Index: b/mm/oom_kill.c =================================================================== --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -399,23 +399,11 @@ static void __oom_kill_task(struct task_ static int oom_kill_task(struct task_struct *p) { - struct task_struct *g, *q; - if (get_oom_adj(p) == OOM_DISABLE) return 1; __oom_kill_task(p, 1); - /* - * kill all processes that share the ->mm (i.e. all threads), - * but are in a different thread group. Don't let them have access - * to memory reserves though, otherwise we might deplete all memory. - */ - do_each_thread(g, q) { - if (q->mm == p->mm && !same_thread_group(q, p)) - force_sig(SIGKILL, q); - } while_each_thread(g, q); - 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: email@kvack.org