tree 1583ac4da9d2e40669d4579e338d8e506dedba5a
parent 37b173a4d03d1681e6c9529bc43d7a3308132db6
author Anton Blanchard <[EMAIL PROTECTED]> Fri, 08 Jul 2005 07:56:06 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Fri, 08 Jul 2005 08:23:36 -0700

[PATCH] mm: quieten OOM killer noise

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]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 mm/oom_kill.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/mm/oom_kill.c b/mm/oom_kill.c
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -258,9 +258,11 @@ void out_of_memory(unsigned int __nocast
        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:
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to