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 E184B6B021E for ; Tue, 1 Jun 2010 03:39:08 -0400 (EDT) Received: from m1.gw.fujitsu.co.jp ([10.0.50.71]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o517d3ZY014815 for (envelope-from kosaki.motohiro@jp.fujitsu.com); Tue, 1 Jun 2010 16:39:03 +0900 Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 2C21045DE53 for ; Tue, 1 Jun 2010 16:39:03 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 0243245DE4F for ; Tue, 1 Jun 2010 16:39:03 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id D1EA3E18005 for ; Tue, 1 Jun 2010 16:39:02 +0900 (JST) Received: from m106.s.css.fujitsu.com (m106.s.css.fujitsu.com [10.249.87.106]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 8E932E18003 for ; Tue, 1 Jun 2010 16:39:02 +0900 (JST) From: KOSAKI Motohiro Subject: Re: [patch -mm 02/18] oom: sacrifice child with highest badness score for parent In-Reply-To: References: Message-Id: <20100601163842.2469.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Tue, 1 Jun 2010 16:39:01 +0900 (JST) Sender: owner-linux-mm@kvack.org To: David Rientjes Cc: kosaki.motohiro@jp.fujitsu.com, Andrew Morton , Rik van Riel , Nick Piggin , Oleg Nesterov , KAMEZAWA Hiroyuki , Balbir Singh , linux-mm@kvack.org List-ID: > When a task is chosen for oom kill, the oom killer first attempts to > sacrifice a child not sharing its parent's memory instead. Unfortunately, > this often kills in a seemingly random fashion based on the ordering of > the selected task's child list. Additionally, it is not guaranteed at all > to free a large amount of memory that we need to prevent additional oom > killing in the very near future. > > Instead, we now only attempt to sacrifice the worst child not sharing its > parent's memory, if one exists. The worst child is indicated with the > highest badness() score. This serves two advantages: we kill a > memory-hogging task more often, and we allow the configurable > /proc/pid/oom_adj value to be considered as a factor in which child to > kill. > > Reviewers may observe that the previous implementation would iterate > through the children and attempt to kill each until one was successful and > then the parent if none were found while the new code simply kills the > most memory-hogging task or the parent. Note that the only time > oom_kill_task() fails, however, is when a child does not have an mm or has > a /proc/pid/oom_adj of OOM_DISABLE. badness() returns 0 for both cases, > so the final oom_kill_task() will always succeed. > > Acked-by: Rik van Riel > Acked-by: Nick Piggin > Acked-by: Balbir Singh > Reviewed-by: KAMEZAWA Hiroyuki > Reviewed-by: Minchan Kim > Reviewed-by: KOSAKI Motohiro > Signed-off-by: David Rientjes ack -- 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