aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Tosatti <marcelo.tosatti@cyclades.com>2005-07-07 20:56:04 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:35 -0400
commit79b9ce311e192e9a31fd9f3cf1ee4a4edf9e2650 (patch)
tree210896405b2b70aded7582750e20967df8c8e7bf
parentcb2c0233755429037462e16ea0d5497a0092738c (diff)
[PATCH] print order information when OOM killing
Dump the current allocation order when OOM killing. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/char/sysrq.c2
-rw-r--r--include/linux/swap.h2
-rw-r--r--mm/oom_kill.c4
-rw-r--r--mm/page_alloc.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index af79805b5576..12d563c648f7 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -228,7 +228,7 @@ static struct sysrq_key_op sysrq_term_op = {
228 228
229static void moom_callback(void *ignored) 229static void moom_callback(void *ignored)
230{ 230{
231 out_of_memory(GFP_KERNEL); 231 out_of_memory(GFP_KERNEL, 0);
232} 232}
233 233
234static DECLARE_WORK(moom_work, moom_callback, NULL); 234static DECLARE_WORK(moom_work, moom_callback, NULL);
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 2343f999e6e1..c75954f2d868 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -148,7 +148,7 @@ struct swap_list_t {
148#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) 148#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
149 149
150/* linux/mm/oom_kill.c */ 150/* linux/mm/oom_kill.c */
151extern void out_of_memory(unsigned int __nocast gfp_mask); 151extern void out_of_memory(unsigned int __nocast gfp_mask, int order);
152 152
153/* linux/mm/memory.c */ 153/* linux/mm/memory.c */
154extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); 154extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 59666d905f19..e20d559edbaf 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -253,12 +253,12 @@ static struct mm_struct *oom_kill_process(struct task_struct *p)
253 * OR try to be smart about which process to kill. Note that we 253 * OR try to be smart about which process to kill. Note that we
254 * don't have to be perfect here, we just have to be good. 254 * don't have to be perfect here, we just have to be good.
255 */ 255 */
256void out_of_memory(unsigned int __nocast gfp_mask) 256void out_of_memory(unsigned int __nocast gfp_mask, int order)
257{ 257{
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); 261 printk("oom-killer: gfp_mask=0x%x, order=%d\n", gfp_mask, order);
262 /* print memory stats */ 262 /* print memory stats */
263 show_mem(); 263 show_mem();
264 264
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3c9f7f881125..7fbd3ea8765c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -936,7 +936,7 @@ rebalance:
936 goto got_pg; 936 goto got_pg;
937 } 937 }
938 938
939 out_of_memory(gfp_mask); 939 out_of_memory(gfp_mask, order);
940 goto restart; 940 goto restart;
941 } 941 }
942 942