From: Janet Morgan <janetmor@us.ibm.com>
To: linux-mm@kvack.org
Cc: davej@redhat.com
Subject: [PATCH] add OOM debug
Date: Thu, 26 May 2005 02:02:13 -0700 [thread overview]
Message-ID: <42959095.1030706@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 234 bytes --]
This patch provides more debug info when the system is OOM. It displays
memory stats (basically sysrq-m info) from __alloc_pages() when page
allocation
fails and during OOM kill.
Thanks to Dave Jones for coming up with the idea.
[-- Attachment #2: showmem.patch --]
[-- Type: text/plain, Size: 1086 bytes --]
Signed-off-by: Janet Morgan <janetmor@us.ibm.com>
--- linux-2.6.12-rc5/mm/oom_kill.c 2005-05-24 20:31:20.000000000 -0700
+++ showmem/mm/oom_kill.c 2005-05-25 11:27:33.000000000 -0700
@@ -258,6 +258,10 @@ void out_of_memory(unsigned int __nocast
struct mm_struct *mm = NULL;
task_t * p;
+ printk("oom-killer: gfp_mask=0x%x\n", gfp_mask);
+ /* print memory stats */
+ show_mem();
+
read_lock(&tasklist_lock);
retry:
p = select_bad_process();
@@ -268,12 +272,9 @@ retry:
/* Found nothing?!?! Either we hang forever, or we panic. */
if (!p) {
read_unlock(&tasklist_lock);
- show_free_areas();
panic("Out of memory and no killable processes...\n");
}
- printk("oom-killer: gfp_mask=0x%x\n", gfp_mask);
- show_free_areas();
mm = oom_kill_process(p);
if (!mm)
goto retry;
--- linux-2.6.12-rc5/mm/page_alloc.c 2005-05-24 20:31:20.000000000 -0700
+++ showmem/mm/page_alloc.c 2005-05-25 11:25:19.000000000 -0700
@@ -905,6 +905,7 @@ nopage:
" order:%d, mode:0x%x\n",
p->comm, order, gfp_mask);
dump_stack();
+ show_mem();
}
return NULL;
got_pg:
reply other threads:[~2005-05-26 17:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=42959095.1030706@us.ibm.com \
--to=janetmor@us.ibm.com \
--cc=davej@redhat.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