From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrea Arcangeli <andrea@suse.de>,
Christoph Lameter <clameter@sgi.com>,
Rik van Riel <riel@redhat.com>,
linux-mm@kvack.org
Subject: [patch 6/8] oom: suppress extraneous stack and memory dump
Date: Wed, 19 Sep 2007 11:24:37 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.0.9999.0709190351290.23538@chino.kir.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.0.9999.0709190351140.23538@chino.kir.corp.google.com>
Suppresses the extraneous stack and memory dump when a parallel OOM
killing has been found. There's no need to fill the ring buffer with
this information if its already been printed and the condition that
triggered the previous OOM killer has not yet been alleviated.
Cc: Andrea Arcangeli <andrea@suse.de>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
mm/oom_kill.c | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -345,12 +345,20 @@ static int oom_kill_task(struct task_struct *p)
return 0;
}
-static int oom_kill_process(struct task_struct *p, unsigned long points,
- const char *message)
+static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
+ unsigned long points, const char *message)
{
struct task_struct *c;
struct list_head *tsk;
+ if (printk_ratelimit()) {
+ printk(KERN_WARNING "%s invoked oom-killer: "
+ "gfp_mask=0x%x, order=%d, oomkilladj=%d\n",
+ current->comm, gfp_mask, order, current->oomkilladj);
+ dump_stack();
+ show_mem();
+ }
+
/*
* If the task is already exiting, don't alarm the sysadmin or kill
* its children or threads, just set TIF_MEMDIE so it can die quickly
@@ -477,14 +485,6 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
/* Got some memory back in the last second. */
return;
- if (printk_ratelimit()) {
- printk(KERN_WARNING "%s invoked oom-killer: "
- "gfp_mask=0x%x, order=%d, oomkilladj=%d\n",
- current->comm, gfp_mask, order, current->oomkilladj);
- dump_stack();
- show_mem();
- }
-
if (sysctl_panic_on_oom == 2)
panic("out of memory. Compulsory panic_on_oom is selected.\n");
@@ -498,7 +498,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
switch (constraint) {
case CONSTRAINT_MEMORY_POLICY:
- oom_kill_process(current, points,
+ oom_kill_process(current, gfp_mask, order, points,
"No available memory (MPOL_BIND)");
break;
@@ -513,7 +513,7 @@ void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order)
if (!oom_kill_asking_task(current))
goto retry;
- oom_kill_process(current, points,
+ oom_kill_process(current, gfp_mask, order, points,
"No available memory in cpuset");
break;
@@ -537,7 +537,8 @@ retry:
panic("Out of memory and no killable processes...\n");
}
- if (oom_kill_process(p, points, "Out of memory"))
+ if (oom_kill_process(p, gfp_mask, order, points,
+ "Out of memory"))
goto retry;
break;
--
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>
next prev parent reply other threads:[~2007-09-19 18:24 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-19 18:24 [patch 0/8] oom killer updates David Rientjes
2007-09-19 18:24 ` [patch 1/8] oom: move prototypes to appropriate header file David Rientjes
2007-09-19 18:24 ` [patch 2/8] oom: move constraints to enum David Rientjes
2007-09-19 18:24 ` [patch 3/8] oom: save zonelist pointer for oom killer calls David Rientjes
2007-09-19 18:24 ` [patch 4/8] oom: serialize out of memory calls David Rientjes
2007-09-19 18:24 ` [patch 5/8] oom: add per-cpuset file oom_kill_asking_task David Rientjes
2007-09-19 18:24 ` David Rientjes [this message]
2007-09-19 18:24 ` [patch 7/8] oom: only kill tasks that share zones with zonelist David Rientjes
2007-09-19 18:24 ` [patch 8/8] oom: do not check cpuset in badness scoring David Rientjes
2007-09-19 19:06 ` Christoph Lameter
2007-09-19 18:57 ` [patch 7/8] oom: only kill tasks that share zones with zonelist Christoph Lameter
2007-09-20 5:50 ` David Rientjes
2007-09-20 17:58 ` Christoph Lameter
2007-09-20 18:37 ` David Rientjes
2007-09-20 18:44 ` Christoph Lameter
2007-09-19 19:00 ` [patch 4/8] oom: serialize out of memory calls Christoph Lameter
2007-09-19 20:30 ` David Rientjes
2007-09-19 19:05 ` [patch 3/8] oom: save zonelist pointer for oom killer calls Christoph Lameter
2007-09-19 20:37 ` David Rientjes
2007-09-19 20:54 ` Christoph Lameter
2007-09-19 21:20 ` David Rientjes
2007-09-19 23:51 ` Tim Pepper
2007-09-20 5:43 ` David Rientjes
2007-09-20 17:56 ` Christoph Lameter
2007-09-19 19:01 ` [patch 1/8] oom: move prototypes to appropriate header file Christoph Lameter
2007-09-19 19:49 ` [patch 0/8] oom killer updates Paul Jackson
2007-09-19 20:24 ` 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.0.9999.0709190351290.23538@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=andrea@suse.de \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.org \
--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