Commit 79b9ce31 authored by Marcelo Tosatti's avatar Marcelo Tosatti Committed by Linus Torvalds

[PATCH] print order information when OOM killing

Dump the current allocation order when OOM killing.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent cb2c0233
...@@ -228,7 +228,7 @@ static struct sysrq_key_op sysrq_term_op = { ...@@ -228,7 +228,7 @@ static struct sysrq_key_op sysrq_term_op = {
static void moom_callback(void *ignored) static void moom_callback(void *ignored)
{ {
out_of_memory(GFP_KERNEL); out_of_memory(GFP_KERNEL, 0);
} }
static DECLARE_WORK(moom_work, moom_callback, NULL); static DECLARE_WORK(moom_work, moom_callback, NULL);
......
...@@ -148,7 +148,7 @@ struct swap_list_t { ...@@ -148,7 +148,7 @@ struct swap_list_t {
#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
/* linux/mm/oom_kill.c */ /* linux/mm/oom_kill.c */
extern void out_of_memory(unsigned int __nocast gfp_mask); extern void out_of_memory(unsigned int __nocast gfp_mask, int order);
/* linux/mm/memory.c */ /* linux/mm/memory.c */
extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
......
...@@ -253,12 +253,12 @@ static struct mm_struct *oom_kill_process(struct task_struct *p) ...@@ -253,12 +253,12 @@ static struct mm_struct *oom_kill_process(struct task_struct *p)
* OR try to be smart about which process to kill. Note that we * OR try to be smart about which process to kill. Note that we
* don't have to be perfect here, we just have to be good. * don't have to be perfect here, we just have to be good.
*/ */
void out_of_memory(unsigned int __nocast gfp_mask) void out_of_memory(unsigned int __nocast gfp_mask, int order)
{ {
struct mm_struct *mm = NULL; struct mm_struct *mm = NULL;
task_t * p; task_t * p;
printk("oom-killer: gfp_mask=0x%x\n", gfp_mask); printk("oom-killer: gfp_mask=0x%x, order=%d\n", gfp_mask, order);
/* print memory stats */ /* print memory stats */
show_mem(); show_mem();
......
...@@ -936,7 +936,7 @@ __alloc_pages(unsigned int __nocast gfp_mask, unsigned int order, ...@@ -936,7 +936,7 @@ __alloc_pages(unsigned int __nocast gfp_mask, unsigned int order,
goto got_pg; goto got_pg;
} }
out_of_memory(gfp_mask); out_of_memory(gfp_mask, order);
goto restart; goto restart;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment