From owner-freebsd-mobile@FreeBSD.ORG Mon Feb 7 16:56:37 2005 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 67B7116A4DE for ; Mon, 7 Feb 2005 16:56:37 +0000 (GMT) Received: from mail23.sea5.speakeasy.net (mail23.sea5.speakeasy.net [69.17.117.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2203C43D31 for ; Mon, 7 Feb 2005 16:56:37 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 17047 invoked from network); 7 Feb 2005 16:56:37 -0000 Received: from server.baldwin.cx ([216.27.160.63]) (envelope-sender )AES256-SHA encrypted SMTP for ; 7 Feb 2005 16:56:32 -0000 Received: from [10.50.40.202] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id j17GuFjh086694; Mon, 7 Feb 2005 11:56:21 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-mobile@FreeBSD.org Date: Mon, 7 Feb 2005 11:52:34 -0500 User-Agent: KMail/1.6.2 References: <1107237354.41ff19ea1f6bc@webmail.understudy.net> In-Reply-To: <1107237354.41ff19ea1f6bc@webmail.understudy.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200502071152.34816.jhb@FreeBSD.org> X-Spam-Status: No, score=-102.8 required=4.2 tests=ALL_TRUSTED, USER_IN_WHITELIST autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx cc: list@understudy.net Subject: Re: Thinkpad 600e interrupt storm X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2005 16:56:37 -0000 On Tuesday 01 February 2005 12:55 am, list@understudy.net wrote: > Hi , > > I have loaded FreeBSD 5.3 on my Thinkpad 600e. However I am getting two > errors on boot up that concern me. > Interrupt storm detected on "irq10: pcic1"; throttling interrupt source > and > Interrupt storm detected on "irq11: pcic0 uhci0"; throttling interrupt > source > > I have been through google and not found a workable solution to removing > the errors. If anyone has an answer could you share it please. Can you try using the interrupt storm modifications from HEAD: Index: kern_intr.c =================================================================== RCS file: /usr/cvs/src/sys/kern/kern_intr.c,v retrieving revision 1.113.2.5 diff -u -r1.113.2.5 kern_intr.c --- kern_intr.c 31 Jan 2005 23:26:15 -0000 1.113.2.5 +++ kern_intr.c 7 Feb 2005 16:51:48 -0000 @@ -485,15 +485,16 @@ struct intrhand *ih; /* and our interrupt handler chain */ struct thread *td; struct proc *p; - int count, warming, warned; + int count, warned, storming; td = curthread; p = td->td_proc; ithd = (struct ithd *)arg; /* point to myself */ KASSERT(ithd->it_td == td && td->td_ithd == ithd, ("%s: ithread and proc linkage out of sync", __func__)); - warming = 10 * intr_storm_threshold; + count = 0; warned = 0; + storming = 0; /* * As long as we have interrupts outstanding, go through the @@ -514,7 +515,6 @@ CTR4(KTR_INTR, "%s: pid %d: (%s) need=%d", __func__, p->p_pid, p->p_comm, ithd->it_need); - count = 0; while (ithd->it_need) { /* * Service interrupts. If another interrupt @@ -548,56 +548,36 @@ if ((ih->ih_flags & IH_MPSAFE) == 0) mtx_unlock(&Giant); } - if (ithd->it_enable != NULL) { - ithd->it_enable(ithd->it_vector); - - /* - * Storm detection needs a delay here - * to see slightly delayed interrupts - * on some machines, but we don't - * want to always delay, so only delay - * while warming up. - * - * XXXRW: Calling DELAY() in the interrupt - * path surely needs to be revisited. - */ - if (warming != 0) { - DELAY(1); - --warming; - } - } /* - * If we detect an interrupt storm, sleep until - * the next hardclock tick. We sleep at the - * end of the loop instead of at the beginning - * to ensure that we see slightly delayed - * interrupts. + * Interrupt storm handling: + * + * If this interrupt source is currently storming, + * then throttle it to only fire the handler once + * 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 (count >= intr_storm_threshold) { + if (!storming && intr_storm_threshold != 0 && + count >= intr_storm_threshold) { if (!warned) { printf( "Interrupt storm detected on \"%s\"; throttling interrupt source\n", p->p_comm); warned = 1; } + storming = 1; + } + if (storming) tsleep(&count, td->td_priority, "istorm", 1); + else + count++; - /* - * Fudge the count to re-throttle if the - * interrupt is still active. Our storm - * detection is too primitive to detect - * whether the storm has gone away - * reliably, even if we were to waste a - * lot of time spinning for the next - * intr_storm_threshold interrupts, so - * we assume that the storm hasn't gone - * away unless the interrupt repeats - * less often the hardclock interrupt. - */ - count = INT_MAX - 1; - } - count++; + if (ithd->it_enable != NULL) + ithd->it_enable(ithd->it_vector); } WITNESS_WARN(WARN_PANIC, NULL, "suspending ithread"); mtx_assert(&Giant, MA_NOTOWNED); @@ -610,6 +590,8 @@ mtx_lock_spin(&sched_lock); 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