Skip to contentSkip to conversation

rate limiting for the ldisc open faulure messages

PATCH In review Akinobu Mita 2 participants 2 messages Aug 31, 2006 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rate limiting for the ldisc open faulure messages

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

 drivers/char/tty_io.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/char/tty_io.c +3 -2
Index: work-shouldfail/drivers/char/tty_io.c
===================================================================
@@ -2072,8 +2072,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;
 }
Acked-by on v1 1/1
#1 lore raw

Ar Iau, 2006-08-31 am 18:49 +0900, ysgrifennodd Akinobu Mita:

Quoted 4 lines

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

I'm suprised it ever occurs but the memory pressure case should indeed be rate limited. Thanks