From owner-p4-projects@FreeBSD.ORG Thu Mar 8 16:23:16 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B185016A405; Thu, 8 Mar 2007 16:23:16 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4E21A16A404 for ; Thu, 8 Mar 2007 16:23:16 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 3041613C48E for ; Thu, 8 Mar 2007 16:23:16 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l28GNGXc065797 for ; Thu, 8 Mar 2007 16:23:16 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l28GNFG2065787 for perforce@freebsd.org; Thu, 8 Mar 2007 16:23:15 GMT (envelope-from piso@freebsd.org) Date: Thu, 8 Mar 2007 16:23:15 GMT Message-Id: <200703081623.l28GNFG2065787@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 115528 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2007 16:23:16 -0000 http://perforce.freebsd.org/chv.cgi?CH=115528 Change 115528 by piso@piso_newluxor on 2007/03/08 16:22:25 As we didn't reach a consensus about interrupt stray handling: o axe MI interrupt stray code and leave a noisy printf instead o axe the MD stray interrupt code for i386 and amd64 Affected files ... .. //depot/projects/soc2006/intr_filter/amd64/amd64/intr_machdep.c#25 edit .. //depot/projects/soc2006/intr_filter/i386/i386/intr_machdep.c#32 edit .. //depot/projects/soc2006/intr_filter/kern/kern_intr.c#35 edit Differences ... ==== //depot/projects/soc2006/intr_filter/amd64/amd64/intr_machdep.c#25 (text+ko) ==== @@ -75,11 +75,8 @@ static struct mtx intr_table_lock; static STAILQ_HEAD(, pic) pics; -extern struct callout stray_callout_handle; - static void intr_eoi_src(void *arg); static void intr_disab_eoi_src(void *arg); -void intr_callout_reset(void); static void intr_event_stray(void *cookie); #ifdef SMP @@ -222,33 +219,7 @@ return (isrc->is_pic->pic_config_intr(isrc, trig, pol)); } -/* Stray detection MD code */ -static struct intr_event * -walk_intr_src(void) -{ - struct intsrc *isrc; - static int i = 0; - - while (i < NUM_IO_INTS) { - mtx_lock_spin(&intr_table_lock); - isrc = interrupt_sources[i++]; - mtx_unlock_spin(&intr_table_lock); - if (isrc != NULL && isrc->is_event != NULL) - return (isrc->is_event); - } - i = 0; - return (NULL); -} - void -intr_callout_reset(void) -{ - - callout_reset(&stray_callout_handle, hz, &stray_detection, - &walk_intr_src); -} - -void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) { struct thread *td; @@ -398,7 +369,6 @@ intrcnt_index = 1; STAILQ_INIT(&pics); mtx_init(&intr_table_lock, "intr table", NULL, MTX_SPIN); - callout_init(&stray_callout_handle, 1); } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL) ==== //depot/projects/soc2006/intr_filter/i386/i386/intr_machdep.c#32 (text+ko) ==== @@ -66,11 +66,8 @@ static struct mtx intr_table_lock; static STAILQ_HEAD(, pic) pics; -extern struct callout stray_callout_handle; - static void intr_eoi_src(void *arg); static void intr_disab_eoi_src(void *arg); -void intr_callout_reset(void); static void intr_event_stray(void *cookie); #ifdef SMP @@ -213,22 +210,6 @@ return (isrc->is_pic->pic_config_intr(isrc, trig, pol)); } -/* Stray detection MD code */ -static struct intr_event * -walk_intrs_src(void) -{ - struct intsrc *isrc; - static int i = 0; - - while (i < NUM_IO_INTS) { - isrc = interrupt_sources[i++]; - if (isrc != NULL && isrc->is_event != NULL) - return (isrc->is_event); - } - i = 0; - return (NULL); -} - void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) { @@ -281,14 +262,6 @@ isrc->is_pic->pic_vector(isrc)); } -void -intr_callout_reset(void) -{ - - callout_reset(&stray_callout_handle, hz, - &stray_detection, &walk_intrs_src); -} - static void intr_eoi_src(void *arg) { @@ -384,8 +357,6 @@ intrcnt_index = 1; STAILQ_INIT(&pics); mtx_init(&intr_table_lock, "intr table", NULL, MTX_SPIN); - callout_init(&stray_callout_handle, 1); - // XXX - we don't drain the callout... } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL) ==== //depot/projects/soc2006/intr_filter/kern/kern_intr.c#35 (text+ko) ==== @@ -58,10 +58,6 @@ #include #endif -/* Stray detection */ -struct callout stray_callout_handle; -static int backoff = 1; - /* MD function */ extern void intr_callout_reset(void); @@ -927,46 +923,6 @@ return (FILTER_STRAY); } -/* Stray storm detection */ -void -stray_detection(void *_arg) -{ - struct intr_thread *ithd = NULL; - struct intr_event *ie; - void *(*walk_src)(void) = _arg; - int thread; - - /* analyze all the interrupt sources... */ - while ((ie = walk_src()) != NULL) { - /* is this interrupt marked as being throttled? */ - if (ie != NULL && ie->ie_count == INT_MAX) { - /* and is the interrupt still pending? */ - if (ie->ie_pending(ie->ie_source)) { - /* - * yes, it's still pending: call filters... - */ - thread = intr_filter_loop(ie, NULL /* XXX frame */, &ithd); - if (thread & FILTER_STRAY) { - /* - * no filter claimed the intr, - * backoff with a longer timeout - */ - backoff++; // XXX we need thresholds... - callout_reset(&stray_callout_handle, hz*backoff, - &stray_detection, _arg); - continue; - } - } - /* - * a filter claimed the intr, or the intr was not - * pending anymore: unmask it - */ - ie->ie_count = 0; - ie->ie_enable(ie->ie_source); - } - } -} - /* * Main interrupt handling body. * @@ -1012,15 +968,9 @@ /* Interrupt storm logic */ if (thread & FILTER_STRAY) { - if (ie->ie_enable == NULL || ie->ie_pending == NULL) - printf("Interrupt stray detection not present:" - "check ie_enable and ie_pending\n"); - else { - printf("Interrupt stray detected on \"%s\";" - "throttling interrupt source\n", ie->ie_name); - ie->ie_count = INT_MAX; - intr_callout_reset(); - } + ie->ie_count++; + if (ie->ie_count < intr_storm_threshold) + printf("Interrupt stray detection not present\n"); } /* Schedule an ithread if needed. */