瀏覽代碼

[PATCH] rate limiting for the ldisc open failure messages

This patch limits the messages when ldisc open faulures happen.  It happens
under memory pressure.

Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Akinobu Mita 18 年之前
父節點
當前提交
4050914f7c
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      drivers/char/tty_io.c

+ 3 - 2
drivers/char/tty_io.c

@@ -2065,8 +2065,9 @@ fail_no_mem:
 
 
 	/* call the tty release_mem routine to clean out this slot */
 	/* call the tty release_mem routine to clean out this slot */
 release_mem_out:
 release_mem_out:
-	printk(KERN_INFO "init_dev: ldisc open failed, "
-			 "clearing slot %d\n", idx);
+	if (printk_ratelimit())
+		printk(KERN_INFO "init_dev: ldisc open failed, "
+				 "clearing slot %d\n", idx);
 	release_mem(tty, idx);
 	release_mem(tty, idx);
 	goto end_init;
 	goto end_init;
 }
 }