linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Rik van Riel <riel@redhat.com>, Nick Piggin <npiggin@suse.de>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	linux-mm@kvack.org
Subject: [patch 01/10 -mm v3] oom: filter tasks not sharing the same cpuset
Date: Wed, 10 Mar 2010 02:41:17 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1003100237420.30013@chino.kir.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1003100236510.30013@chino.kir.corp.google.com>

Tasks that do not share the same set of allowed nodes with the task that
triggered the oom should not be considered as candidates for oom kill.

Tasks in other cpusets with a disjoint set of mems would be unfairly
penalized otherwise because of oom conditions elsewhere; an extreme
example could unfairly kill all other applications on the system if a
single task in a user's cpuset sets itself to OOM_DISABLE and then uses
more memory than allowed.

Killing tasks outside of current's cpuset rarely would free memory for
current anyway.  To use a sane heuristic, we must ensure that killing a
task would likely free memory for current and avoid needlessly killing
others at all costs just because their potential memory freeing is
unknown.  It is better to kill current than another task needlessly.

Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Nick Piggin <npiggin@suse.de>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/oom_kill.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -35,7 +35,7 @@ static DEFINE_SPINLOCK(zone_scan_lock);
 /* #define DEBUG */
 
 /*
- * Is all threads of the target process nodes overlap ours?
+ * Do all threads of the target process overlap our allowed nodes?
  */
 static int has_intersects_mems_allowed(struct task_struct *tsk)
 {
@@ -167,14 +167,6 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
 		points /= 4;
 
 	/*
-	 * If p's nodes don't overlap ours, it may still help to kill p
-	 * because p may have allocated or otherwise mapped memory on
-	 * this node before. However it will be less likely.
-	 */
-	if (!has_intersects_mems_allowed(p))
-		points /= 8;
-
-	/*
 	 * Adjust the score by oom_adj.
 	 */
 	if (oom_adj) {
@@ -266,6 +258,8 @@ static struct task_struct *select_bad_process(unsigned long *ppoints,
 			continue;
 		if (mem && !task_in_mem_cgroup(p, mem))
 			continue;
+		if (!has_intersects_mems_allowed(p))
+			continue;
 
 		/*
 		 * This task already has access to memory reserves and is

--
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>

  reply	other threads:[~2010-03-10 10:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10 10:41 [patch 00/10 -mm v3] oom killer rewrite David Rientjes
2010-03-10 10:41 ` David Rientjes [this message]
2010-03-10 10:41 ` [patch 02/10 -mm v3] oom: sacrifice child with highest badness score for parent David Rientjes
2010-03-10 10:41 ` [patch 03/10 -mm v3] oom: select task from tasklist for mempolicy ooms David Rientjes
2010-03-10 10:41 ` [patch 04/10 -mm v3] oom: remove special handling for pagefault ooms David Rientjes
2010-03-10 10:41 ` [patch 05/10 -mm v3] oom: badness heuristic rewrite David Rientjes
2010-03-12  6:20   ` KAMEZAWA Hiroyuki
2010-03-17  1:26     ` David Rientjes
2010-03-17  1:44       ` KAMEZAWA Hiroyuki
2010-03-17  3:30         ` David Rientjes
2010-03-10 10:41 ` [patch 06/10 -mm v3] oom: deprecate oom_adj tunable David Rientjes
2010-03-10 10:41 ` [patch 07/10 -mm v3] oom: replace sysctls with quick mode David Rientjes
2010-03-10 10:41 ` [patch 08/10 -mm v3] oom: avoid oom killer for lowmem allocations David Rientjes
2010-03-10 10:41 ` [patch 09/10 -mm v3] oom: remove unnecessary code and cleanup David Rientjes
2010-03-10 10:41 ` [patch 10/10 -mm v3] oom: default to killing current for pagefault ooms David Rientjes
2010-03-12  7:34 ` [patch 00/10 -mm v3] oom killer rewrite KAMEZAWA Hiroyuki
2010-03-17  1:00   ` David Rientjes
2010-03-12  7:46 ` KAMEZAWA Hiroyuki
2010-03-17  1:21   ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1003100237420.30013@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    --cc=riel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox