* [PATCH] add OOM debug
@ 2005-05-26 9:02 Janet Morgan
0 siblings, 0 replies; only message in thread
From: Janet Morgan @ 2005-05-26 9:02 UTC (permalink / raw)
To: linux-mm; +Cc: davej
[-- 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:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-05-26 17:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-26 9:02 [PATCH] add OOM debug Janet Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox