All of lore.kernel.org
 help / color / mirror / Atom feed
* [rfc] suppress excessive AER output
@ 2011-08-03 22:34 Dave Jones
  2011-08-04  5:54 ` Zhang, Yanmin
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Dave Jones @ 2011-08-03 22:34 UTC (permalink / raw)
  To: Linux Kernel; +Cc: tom.l.nguyen, yanmin.zhang

I have a machine that has developed some kind of problem with
its onboard ethernet.  It still boots, but spewed almost 1.5G of text
(2381585 instances of the warning below) before we realised what
was going on, and blacklisted the igb driver.

Is it worth logging every single error when we're flooding like this ?
It seems unlikely that we'll find useful information in amongst that much data
that wasn't already in the first 100 instances.

I picked 100 in the (untested) example patch below arbitarily, but the exact
value could be smaller, or slightly bigger..

could we do something like this maybe ?

	Dave

diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c
index 3ea5173..4ec88c6 100644
--- a/drivers/pci/pcie/aer/aerdrv_errprint.c
+++ b/drivers/pci/pcie/aer/aerdrv_errprint.c
@@ -153,6 +153,17 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
 {
 	int id = ((dev->bus->number << 8) | dev->devfn);
 	char prefix[44];
+	static unsigned long aer_printk_limit = 0;
+
+	aer_printk_limit++;
+
+	if (aer_printk_limit > 100)
+		return;
+
+	if (aer_printk_limit == 100) {
+		printk(KERN_ERR "Reached limit of 100 AER errors. Further AER output suppressed.\n");
+		return;
+	}
 
 	snprintf(prefix, sizeof(prefix), "%s%s %s: ",
 		 (info->severity == AER_CORRECTABLE) ? KERN_WARNING : KERN_ERR,

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

end of thread, other threads:[~2011-08-05  2:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-03 22:34 [rfc] suppress excessive AER output Dave Jones
2011-08-04  5:54 ` Zhang, Yanmin
2011-08-05  1:50   ` Dave Jones
2011-08-05  1:59     ` Zhang, Yanmin
2011-08-05  2:09       ` Dave Jones
2011-08-04  6:45 ` huang ying
2011-08-05  1:50   ` Dave Jones
2011-08-05  2:24 ` Arnaud Lacombe
2011-08-05  2:33   ` Dave Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.