Commit 5d87f5bd authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] oom-killer: call show_free_areas

Change the oom-killer so that it spits a sysrq-m output into the logs, and
shows the gfp_mask of the failing allocation attempt.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0e315813
......@@ -148,7 +148,7 @@ struct swap_list_t {
#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
/* linux/mm/oom_kill.c */
extern void out_of_memory(void);
extern void out_of_memory(int gfp_mask);
/* linux/mm/memory.c */
extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
......
......@@ -220,7 +220,7 @@ static void oom_kill(void)
/**
* out_of_memory - is the system out of memory?
*/
void out_of_memory(void)
void out_of_memory(int gfp_mask)
{
/*
* oom_lock protects out_of_memory()'s static variables.
......@@ -271,6 +271,9 @@ void out_of_memory(void)
*/
lastkill = now;
printk("oom-killer: gfp_mask=0x%x\n", gfp_mask);
show_free_areas();
/* oom_kill() sleeps */
spin_unlock(&oom_lock);
oom_kill();
......
......@@ -949,7 +949,7 @@ int try_to_free_pages(struct zone **zones,
blk_congestion_wait(WRITE, HZ/10);
}
if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY))
out_of_memory();
out_of_memory(gfp_mask);
out:
for (i = 0; zones[i] != 0; i++)
zones[i]->prev_priority = zones[i]->temp_priority;
......
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