From jeremyp@gsmx07.alcatel.com.au  Sun Jun  3 17:00:51 2001
Return-Path: <jeremyp@gsmx07.alcatel.com.au>
Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27])
	by hub.freebsd.org (Postfix) with ESMTP id B4F7E37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  3 Jun 2001 17:00:49 -0700 (PDT)
	(envelope-from jeremyp@gsmx07.alcatel.com.au)
Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1])
	by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id KAA16353
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 4 Jun 2001 10:00:47 +1000 (EST)
Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au
 (PMDF V5.2-32 #37640) with ESMTP id <01K4D5E41K28VLKOJ3@cim.alcatel.com.au>
 for FreeBSD-gnats-submit@freebsd.org; Mon, 4 Jun 2001 10:00:29 +1000
Received: (from jeremyp@localhost)	by gsmx07.alcatel.com.au (8.11.1/8.11.1)
 id f5400PU71784; Mon, 04 Jun 2001 10:00:25 +1000 (EST envelope-from jeremyp)
Message-Id: <200106040000.f5400PU71784@gsmx07.alcatel.com.au>
Date: Mon, 04 Jun 2001 10:00:25 +1000 (EST)
From: peter.jeremy@alcatel.com.au
Reply-To: peter.jeremy@alcatel.com.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: Fast interrupts handled via interrupt threads
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         27866
>Category:       alpha
>Synopsis:       Fast interrupts handled via interrupt threads
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-alpha
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 03 17:10:00 PDT 2001
>Closed-Date:    Sun Jun 3 17:52:39 PDT 2001
>Last-Modified:  Sun Jun 03 17:52:58 PDT 2001
>Originator:     Peter Jeremy
>Release:        FreeBSD 5.0-CURRENT alpha
>Organization:
Alcatel Australia Limited
>Environment:
5.0-CURRENT from around 25th May

>Description:
	`Fast' interrupts can be handled synchronously by calling
	the bus and device interrupt handler directly from
	/sys/alpha/alpha/interrupt.c:alpha_dispatch_intr(), whereas
	other interrupts are scheduled as interrupt threads.

	Unfortunately, the test for fast interrupts in interrupt.c
	incorrectly uses INTR_FAST instead of IH_FAST, so fast
	interrupts aren't detected.  This significantly increases
	latencies for fast interrupts and can lead to SILO overflows.

	This was detected by some code I added to determine what was
	contributing to sio interrupt latencies.  I discovered that
	the `fast interrupt found' probe was not being triggered.

>How-To-Repeat:
	Code inspection:  If alpha_setup_intr() is called with
	INTR_FAST specified in <flags>, this will be passed onto
	ithread_add_handler() where it will be mapped to
	(IH_FAST | IH_EXCLUSIVE) in (struct intrhand).ih_flags.

	When the interrupt occurs, alpha_dispatch_intr() tests
	(struct intrhand).ih_flags against INTR_FAST and so fails
	to detect that it is a fast interrupt.

>Fix:

	[This fix has been tested on my Multia, but the following is
	a re-type of the fix]
Index: interrupt.c
===================================================================
RCS file: /home/CVSROOT/src/sys/alpha/alpha/interrupt.c,v
retrieving revision 1.52
diff -u -r1.52 interrupt.c
--- interrupt.c	2001/05/15 23:22:17	1.52
+++ interrupt.c	2001/06/03 23:41:17
@@ -434,7 +434,7 @@
 	 * that this means that any fast interrupt handler must be MP safe.
 	 */
 	ih = TAILQ_FIRST(&ithd->it_handlers);
-	if ((ih->ih_flags & INTR_FAST) != 0) {
+	if ((ih->ih_flags & IH_FAST) != 0) {
 		ih->ih_handler(ih->ih_argument);
 		return;
 	}
>Release-Note:
>Audit-Trail:

From: Matthew Jacob <mjacob@feral.com>
To: peter.jeremy@alcatel.com.au
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: alpha/27866: Fast interrupts handled via interrupt threads
Date: Sun, 3 Jun 2001 17:16:00 -0700 (PDT)

 Good eye. WHy no mail to alpha@?
 
 
 
State-Changed-From-To: open->closed 
State-Changed-By: mjacob 
State-Changed-When: Sun Jun 3 17:52:39 PDT 2001 
State-Changed-Why:  
Easy and correct fix. Applied. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27866 
>Unformatted:
