From owner-p4-projects@FreeBSD.ORG Thu Oct 28 15:27:02 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C1DA616A4D0; Thu, 28 Oct 2004 15:27:01 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EB0C16A4CE for ; Thu, 28 Oct 2004 15:27:01 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64CFB43D1F for ; Thu, 28 Oct 2004 15:27:01 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9SFR11w084329 for ; Thu, 28 Oct 2004 15:27:01 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9SFR1FC084325 for perforce@freebsd.org; Thu, 28 Oct 2004 15:27:01 GMT (envelope-from jhb@freebsd.org) Date: Thu, 28 Oct 2004 15:27:01 GMT Message-Id: <200410281527.i9SFR1FC084325@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Subject: PERFORCE change 63883 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2004 15:27:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=63883 Change 63883 by jhb@jhb_slimer on 2004/10/28 15:26:59 Remove bde's pessimizations to the interrupt storm detection code. Affected files ... .. //depot/projects/smpng/sys/kern/kern_intr.c#54 edit Differences ... ==== //depot/projects/smpng/sys/kern/kern_intr.c#54 (text+ko) ==== @@ -485,22 +485,14 @@ struct intrhand *ih; /* and our interrupt handler chain */ struct thread *td; struct proc *p; -#ifdef HACK - int count, warming, warned; -#else int count, warned; -#endif 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__)); -#ifdef HACK - warming = 10 * intr_storm_threshold; -#else count = 0; -#endif warned = 0; /* @@ -522,9 +514,6 @@ CTR4(KTR_INTR, "%s: pid %d: (%s) need=%d", __func__, p->p_pid, p->p_comm, ithd->it_need); -#ifdef HACK - count = 0; -#endif while (ithd->it_need) { /* * Service interrupts. If another interrupt @@ -559,7 +548,6 @@ mtx_unlock(&Giant); } -#ifndef HACK /* * If we detect an interrupt storm, pause with the * source masked until the next hardclock tick. @@ -576,62 +564,9 @@ count = 0; } else count++; -#endif - if (ithd->it_enable != NULL) { + if (ithd->it_enable != NULL) ithd->it_enable(ithd->it_vector); -#ifdef HACK - /* - * 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; - } -#endif - } - -#ifdef HACK - /* - * 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. - */ - if (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; - } - tsleep(&count, td->td_priority, "istorm", 1); - - /* - * 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++; -#endif } WITNESS_WARN(WARN_PANIC, NULL, "suspending ithread"); mtx_assert(&Giant, MA_NOTOWNED); @@ -644,9 +579,7 @@ mtx_lock_spin(&sched_lock); if (!ithd->it_need) { TD_SET_IWAIT(td); -#ifndef HACK count = 0; -#endif 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);