Skip to content

Commit

Permalink
[PATCH] mm: quieten OOM killer noise
Browse files Browse the repository at this point in the history
We now print statistics when invoking the OOM killer, however this
information is not rate limited and you can get into situations where the
console is continually spammed.

For example, when a task is exiting the OOM killer will simply return
(waiting for that task to exit and clear up memory).  If the VM continually
calls back into the OOM killer we get thousands of copies of show_mem() on
the console.

Use printk_ratelimit() to quieten it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Anton Blanchard authored and Linus Torvalds committed Jul 8, 2005
1 parent 37b173a commit 4263926
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,11 @@ void out_of_memory(unsigned int __nocast gfp_mask, int order)
struct mm_struct *mm = NULL;
task_t * p;

printk("oom-killer: gfp_mask=0x%x, order=%d\n", gfp_mask, order);
/* print memory stats */
show_mem();
if (printk_ratelimit()) {
printk("oom-killer: gfp_mask=0x%x, order=%d\n",
gfp_mask, order);
show_mem();
}

read_lock(&tasklist_lock);
retry:
Expand Down

0 comments on commit 4263926

Please sign in to comment.