From d0b4135e008c4cf77e739fbb312c54316c49eecf Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 17 Nov 2004 14:39:41 +0000 Subject: [PATCH] Don't bother exiting storming mode once a second to see if it has gone away, instead only exit storming mode when an interrupt stops firing long enough for the ithread to exit the loop and go back to sleep. Tested by: macrus (cruder version) --- sys/kern/kern_intr.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index 1156883f546c..936cc304f04c 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -554,22 +554,14 @@ restart: * * If this interrupt source is currently storming, * then throttle it to only fire the handler once - * per clock tick. Each second we go out of storming - * mode to see if the storm has subsided. + * per clock tick. * * If this interrupt source is not currently * storming, but the number of back to back * interrupts exceeds the storm threshold, then * enter storming mode. */ - if (storming) { - tsleep(&count, td->td_priority, "istorm", 1); - if (count > hz) { - storming = 0; - count = 0; - } else - count++; - } else if (intr_storm_threshold != 0 && + if (!storming && intr_storm_threshold != 0 && count >= intr_storm_threshold) { if (!warned) { printf( @@ -578,8 +570,10 @@ restart: warned = 1; } storming = 1; - count = 0; - } else + } + if (storming) + tsleep(&count, td->td_priority, "istorm", 1); + else count++; if (ithd->it_enable != NULL)