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: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Balbir Singh <balbir@in.ibm.com>,
	linux-mm@kvack.org
Subject: [patch -mm] memcg: make oom killer a no-op when no killable task can be found
Date: Tue, 4 May 2010 16:51:14 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.1005041650040.13683@chino.kir.corp.google.com> (raw)

It's pointless to try to kill current if select_bad_process() did not
find an eligible task to kill in mem_cgroup_out_of_memory() since it's
guaranteed that current is a member of the memcg that is oom and it is,
by definition, unkillable.

Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 mm/oom_kill.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -512,12 +512,9 @@ void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask)
 	read_lock(&tasklist_lock);
 retry:
 	p = select_bad_process(&points, limit, mem, CONSTRAINT_NONE, NULL);
-	if (PTR_ERR(p) == -1UL)
+	if (!p || PTR_ERR(p) == -1UL)
 		goto out;
 
-	if (!p)
-		p = current;
-
 	if (oom_kill_process(p, gfp_mask, 0, points, limit, mem,
 				"Memory cgroup out of memory"))
 		goto retry;

--
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-05-04 23:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-04 23:51 David Rientjes [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-03-28 14:55 [PATCH] oom killer: break from infinite loop anfei
2010-03-28 16:28 ` Oleg Nesterov
2010-03-28 21:21   ` David Rientjes
2010-03-29 14:06     ` anfei
2010-03-29 20:01       ` David Rientjes
2010-03-30 14:29         ` anfei
2010-03-30 20:29           ` David Rientjes
2010-03-31  0:57             ` KAMEZAWA Hiroyuki
2010-03-31  6:07               ` David Rientjes
2010-03-31  6:13                 ` KAMEZAWA Hiroyuki
2010-03-31  6:30                   ` Balbir Singh
2010-03-31  6:32                     ` David Rientjes
2010-03-31  7:08                       ` [patch -mm] memcg: make oom killer a no-op when no killable task can be found David Rientjes
2010-03-31  7:08                         ` KAMEZAWA Hiroyuki
2010-03-31  8:04                         ` Balbir Singh
2010-03-31 10:38                           ` David Rientjes
2010-04-04 23:28                         ` David Rientjes
2010-04-05 21:30                           ` Andrew Morton
2010-04-05 22:40                             ` David Rientjes
2010-04-05 22:49                               ` Andrew Morton
2010-04-05 23:01                                 ` David Rientjes
2010-04-06 12:08                                   ` KOSAKI Motohiro
2010-04-06 21:47                                     ` David Rientjes
2010-04-07  0:20                                       ` KAMEZAWA Hiroyuki
2010-04-07 13:29                                         ` KOSAKI Motohiro
2010-04-08 18:05                                           ` David Rientjes
2010-04-21 19:17                                             ` Andrew Morton
2010-04-21 22:04                                               ` David Rientjes
2010-04-22  0:23                                                 ` KAMEZAWA Hiroyuki
2010-04-22  8:34                                                   ` David Rientjes
2010-04-22  7:23                                               ` Nick Piggin
2010-04-22  7:25                                                 ` KAMEZAWA Hiroyuki
2010-04-22 10:09                                                   ` Nick Piggin
2010-04-22 10:27                                                     ` KAMEZAWA Hiroyuki
2010-04-22 21:11                                                       ` David Rientjes
2010-04-22 10:28                                                     ` David Rientjes
2010-04-22 15:39                                                       ` Nick Piggin
2010-04-22 21:09                                                         ` David Rientjes
2010-05-04 23:55                                               ` David Rientjes
2010-04-08 17:36                                         ` 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.1005041650040.13683@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@in.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    /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