[PATCH] quieten OOM killer noise

From: Anton Blanchard
Date: Sun Jul 03 2005 - 11:08:18 EST



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@xxxxxxxxx>

Index: foobar2/mm/oom_kill.c
===================================================================
--- foobar2.orig/mm/oom_kill.c 2005-07-02 15:56:13.000000000 +1000
+++ foobar2/mm/oom_kill.c 2005-07-04 01:38:59.474324542 +1000
@@ -258,9 +258,11 @@
struct mm_struct *mm = NULL;
task_t * p;

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

read_lock(&tasklist_lock);
retry:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/