diff options
| author | Janet Morgan <janetmor@us.ibm.com> | 2005-06-21 20:14:56 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 21:46:17 -0400 |
| commit | 578c2fd6a7f378434655e5c480e23152a3994404 (patch) | |
| tree | 3a6408c416e3825cd17e33ac776425a52b743adc | |
| parent | c2f29ea111e3344ed48257c2a142c3db514e1529 (diff) | |
[PATCH] add OOM debug
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.
Signed-off-by: Janet Morgan <janetmor@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | mm/oom_kill.c | 7 | ||||
| -rw-r--r-- | mm/page_alloc.c | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 4bbb1cb10495..59666d905f19 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
| @@ -258,6 +258,10 @@ void out_of_memory(unsigned int __nocast gfp_mask) | |||
| 258 | struct mm_struct *mm = NULL; | 258 | struct mm_struct *mm = NULL; |
| 259 | task_t * p; | 259 | task_t * p; |
| 260 | 260 | ||
| 261 | printk("oom-killer: gfp_mask=0x%x\n", gfp_mask); | ||
| 262 | /* print memory stats */ | ||
| 263 | show_mem(); | ||
| 264 | |||
| 261 | read_lock(&tasklist_lock); | 265 | read_lock(&tasklist_lock); |
| 262 | retry: | 266 | retry: |
| 263 | p = select_bad_process(); | 267 | p = select_bad_process(); |
| @@ -268,12 +272,9 @@ retry: | |||
| 268 | /* Found nothing?!?! Either we hang forever, or we panic. */ | 272 | /* Found nothing?!?! Either we hang forever, or we panic. */ |
| 269 | if (!p) { | 273 | if (!p) { |
| 270 | read_unlock(&tasklist_lock); | 274 | read_unlock(&tasklist_lock); |
| 271 | show_free_areas(); | ||
| 272 | panic("Out of memory and no killable processes...\n"); | 275 | panic("Out of memory and no killable processes...\n"); |
| 273 | } | 276 | } |
| 274 | 277 | ||
| 275 | printk("oom-killer: gfp_mask=0x%x\n", gfp_mask); | ||
| 276 | show_free_areas(); | ||
| 277 | mm = oom_kill_process(p); | 278 | mm = oom_kill_process(p); |
| 278 | if (!mm) | 279 | if (!mm) |
| 279 | goto retry; | 280 | goto retry; |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 10446a646374..be05d17bd7df 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -935,6 +935,7 @@ nopage: | |||
| 935 | " order:%d, mode:0x%x\n", | 935 | " order:%d, mode:0x%x\n", |
| 936 | p->comm, order, gfp_mask); | 936 | p->comm, order, gfp_mask); |
| 937 | dump_stack(); | 937 | dump_stack(); |
| 938 | show_mem(); | ||
| 938 | } | 939 | } |
| 939 | return NULL; | 940 | return NULL; |
| 940 | got_pg: | 941 | got_pg: |
