Skip to content

Commit cd3ecad

Browse files
Daniel Drakegregkh
authored andcommitted
serial8250: ratelimit "too much work" error
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. [akpm@linux-foundation.org: use the superior printk_ratelimited()] [akpm@linux-foundation.org: printk_ratelimited() needs ratelimit.h] Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 0dd25df commit cd3ecad

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎drivers/serial/8250.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <linux/delay.h>
3232
#include <linux/platform_device.h>
3333
#include <linux/tty.h>
34+
#include <linux/ratelimit.h>
3435
#include <linux/tty_flip.h>
3536
#include <linux/serial_reg.h>
3637
#include <linux/serial_core.h>
@@ -1600,8 +1601,8 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
16001601

16011602
if (l == i->head && pass_counter++ > PASS_LIMIT) {
16021603
/* If we hit this, we're dead. */
1603-
printk(KERN_ERR "serial8250: too much work for "
1604-
"irq%d\n", irq);
1604+
printk_ratelimited(KERN_ERR
1605+
"serial8250: too much work for irq%d\n", irq);
16051606
break;
16061607
}
16071608
} while (l != end);

0 commit comments

Comments
 (0)