From owner-freebsd-current@FreeBSD.ORG Mon Nov 15 19:45:13 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC8BA16A552 for ; Mon, 15 Nov 2004 19:45:12 +0000 (GMT) Received: from mail4.speakeasy.net (mail4.speakeasy.net [216.254.0.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7308043D4C for ; Mon, 15 Nov 2004 19:45:12 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 13762 invoked from network); 15 Nov 2004 19:45:12 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 15 Nov 2004 19:45:11 -0000 Received: from [10.50.41.235] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id iAFJj0s6076045; Mon, 15 Nov 2004 14:45:04 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-current@FreeBSD.org Date: Mon, 15 Nov 2004 14:24:49 -0500 User-Agent: KMail/1.6.2 References: <1100176749.41935d6d12032@netchild.homeip.net> <20041111223705.GL582@hub.freebsd.org> In-Reply-To: <20041111223705.GL582@hub.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411151424.49790.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Alexander@Leidinger.net cc: Kris Kennaway cc: Joe Marcus Clarke cc: Robert Watson cc: current@FreeBSD.org Subject: Re: 6-CURRENT unbelievably slow? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2004 19:45:13 -0000 On Thursday 11 November 2004 05:37 pm, Kris Kennaway wrote: > On Thu, Nov 11, 2004 at 01:39:09PM +0100, Alexander@Leidinger.net wrote: > > Zitat von Joe Marcus Clarke : > > > I noticed the interrupt storm detection line in dmesg. In previous > > > builds, this worked, but it doesn't seem to be taking effect anymore. > > > > AFAIK the interrupt storm detection was removed (at least partially). > > s/removed/fixed so it doesn't give so many false positives/ > > (at least partially) ;-) > > Talk to jhb.. Please try this patch out and let me know if it does any better: --- //depot/vendor/freebsd/src/sys/kern/kern_intr.c 2004/11/05 19:15:40 +++ //depot/projects/smpng/sys/kern/kern_intr.c 2004/11/15 19:20:11 @@ -485,7 +485,7 @@ struct intrhand *ih; /* and our interrupt handler chain */ struct thread *td; struct proc *p; - int count, warned; + int count, warned, storming; td = curthread; p = td->td_proc; @@ -494,6 +494,7 @@ ("%s: ithread and proc linkage out of sync", __func__)); count = 0; warned = 0; + storming = 0; /* * As long as we have interrupts outstanding, go through the @@ -549,10 +550,26 @@ } /* - * If we detect an interrupt storm, pause with the - * source masked until the next hardclock tick. + * Interrupt storm handling: + * + * 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. + * + * 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 (intr_storm_threshold != 0 && + if (storming) { + tsleep(&count, td->td_priority, "istorm", 1); + if (count > hz) { + storming = 0; + count = 0; + } else + count++; + } else if (intr_storm_threshold != 0 && count >= intr_storm_threshold) { if (!warned) { printf( @@ -560,7 +577,7 @@ p->p_comm); warned = 1; } - tsleep(&count, td->td_priority, "istorm", 1); + storming = 1; count = 0; } else count++; @@ -580,6 +597,7 @@ if (!ithd->it_need) { TD_SET_IWAIT(td); count = 0; + storming = 0; CTR2(KTR_INTR, "%s: pid %d: done", __func__, p->p_pid); mi_switch(SW_VOL, NULL); CTR2(KTR_INTR, "%s: pid %d: resumed", __func__, p->p_pid); -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org