public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial8250: ratelimit "too much work" error
@ 2010-10-02 11:04 Daniel Drake
  2010-10-02 14:22 ` Alan Cox
  2010-10-04 21:51 ` Andrew Morton
  0 siblings, 2 replies; 11+ messages in thread
From: Daniel Drake @ 2010-10-02 11:04 UTC (permalink / raw)
  To: akpm; +Cc: linux-serial, linux-kernel

Running a serial console, if too many kernel messages are generated within
a short time causing a lot of serial I/O, the 8250 driver will generate
another kernel message reporting this, which just adds to the I/O. It has
a cascading effect and quickly results the system being brought to its knees
by a flood of "too much work" messages.

Ratelimit the error message to avoid this.

Signed-off-by: Daniel Drake <dsd@laptop.org>
---
 drivers/serial/8250.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 24110f6..d3c5855 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1606,8 +1606,9 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
 
 		if (l == i->head && pass_counter++ > PASS_LIMIT) {
 			/* If we hit this, we're dead. */
-			printk(KERN_ERR "serial8250: too much work for "
-				"irq%d\n", irq);
+			if (printk_ratelimit())
+				printk(KERN_ERR "serial8250: too much work for "
+					"irq%d\n", irq);
 			break;
 		}
 	} while (l != end);
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-10-05  0:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-02 11:04 [PATCH] serial8250: ratelimit "too much work" error Daniel Drake
2010-10-02 14:22 ` Alan Cox
2010-10-04 21:51 ` Andrew Morton
2010-10-04 22:02   ` Andrew Morton
2010-10-04 22:10     ` Joe Perches
2010-10-04 22:21       ` Andrew Morton
2010-10-04 22:59         ` Joe Perches
2010-10-04 23:11           ` Andrew Morton
2010-10-04 23:34             ` Joe Perches
2010-10-04 23:49               ` Andrew Morton
2010-10-05  0:26                 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox