From: Akinobu Mita Date: Fri, 29 Sep 2006 09:01:27 +0000 (-0700) Subject: [PATCH] rate limiting for the ldisc open failure messages X-Git-Tag: v2.6.19-rc1~679 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4050914f7c2665736a82265a029466071a90094e;p=platform%2Fkernel%2Flinux-exynos.git [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 Acked-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 6354373..33374177 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -2065,8 +2065,9 @@ fail_no_mem: /* call the tty release_mem routine to clean out this slot */ 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); goto end_init; }