From 0ae62c18a07d9d8eff31f40711ecba714ab0be4f Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Thu, 19 Apr 2007 01:24:32 +0000 Subject: [PATCH] Bump the interrupt storm detection counter to 1000. My slow fileserver gets a bogus irq storm detected when periodic daily kicks off at 3 am and disconnects the disk. Change the print logic to print once per second when the storm is occurring instead of only once. Otherwise, it appeared that something else was causing the errors each night at 3 am since the print only occurred the first time. Reviewed by: jhb MFC after: 1 week --- sys/kern/kern_intr.c | 8 ++++---- sys/sys/interrupt.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index 38c677253e4c..94e26720ab25 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -83,7 +83,7 @@ void *vm_ih; static MALLOC_DEFINE(M_ITHREAD, "ithread", "Interrupt Threads"); -static int intr_storm_threshold = 500; +static int intr_storm_threshold = 1000; TUNABLE_INT("hw.intr_storm_threshold", &intr_storm_threshold); SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RW, &intr_storm_threshold, 0, @@ -698,11 +698,11 @@ ithread_execute_handlers(struct proc *p, struct intr_event *ie) */ if (intr_storm_threshold != 0 && ie->ie_count >= intr_storm_threshold && !(ie->ie_flags & IE_SOFT)) { - if (ie->ie_warned == 0) { + /* Report the message only once every second. */ + if (ppsratecheck(&ie->ie_warntm, &ie->ie_warncnt, 1)) { printf( - "Interrupt storm detected on \"%s\"; throttling interrupt source\n", + "interrupt storm detected on \"%s\"; throttling interrupt source\n", ie->ie_name); - ie->ie_warned = 1; } pause("istorm", 1); } else diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h index cfbb28f39034..9ca87d292ba4 100644 --- a/sys/sys/interrupt.h +++ b/sys/sys/interrupt.h @@ -74,7 +74,8 @@ struct intr_event { void (*ie_enable)(void *); int ie_flags; int ie_count; /* Loop counter. */ - int ie_warned; /* Warned about interrupt storm. */ + int ie_warncnt; /* Rate-check interrupt storm warns. */ + struct timeval ie_warntm; }; /* Interrupt event flags kept in ie_flags. */