[PATCH] quieten OOM killer noise

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux