Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Sep 2000 23:32:31 +0100
From:      Ben Smithurst <ben@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        current@FreeBSD.ORG, jasone@FreeBSD.org, jhb@FreeBSD.org
Subject:   Re: page fault in sched_ithd
Message-ID:  <20000914233231.N77593@strontium.scientia.demon.co.uk>
In-Reply-To: <Pine.BSF.4.21.0009111312230.401-100000@besplex.bde.org>
References:  <20000909210619.F77593@strontium.scientia.demon.co.uk> <Pine.BSF.4.21.0009111312230.401-100000@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Ls2Gy6y7jbHLe9Od
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Bruce Evans wrote:

> On Sat, 9 Sep 2000, Ben Smithurst wrote:
> 
>> After poking around a bit with remote GDB, this seems to be caused by a
>> stray IRQ 7, since irq == 7, ir == ithds[irq] == NULL, ir->foo == BOOM.
>> 
>> The attached rather crude patch has "fixed" the problem for now, but
>> does anyone have any suggestions for a real fix?
> 
> The stray interrupt handler needs to have a thread, or stray interrupts
> need to be handled as traps.  Stray interrupts are more like NMIs than
> normal interrupts, and NMIs are already (mis)handled as traps.

OK, but would you or anyone else object to the attached patch as a
temporary fix, at least?  Page-faulting almost immediately is not
particularly good.  The patch doesn't seem to have had any negative
effects so far.

Who are the main people responsible for the SMPng stuff anyway? jasone
and jhb seem to have been involved a bit, so I cc'd them as well.

-- 
Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D

--Ls2Gy6y7jbHLe9Od
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ithread.diff"

Index: ithread.c
===================================================================
RCS file: /usr/cvs/src/sys/i386/isa/ithread.c,v
retrieving revision 1.3
diff -u -r1.3 ithread.c
--- ithread.c	2000/09/13 18:33:23	1.3
+++ ithread.c	2000/09/14 22:06:44
@@ -95,6 +95,8 @@
 
 SYSINIT(start_softintr, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softintr, NULL)
 
+#define	MAX_STRAY_LOG	5
+
 /*
  * Schedule a heavyweight interrupt process.  This function is called
  * from the interrupt handlers Xintr<num>.
@@ -103,6 +105,7 @@
 sched_ithd(void *cookie)
 {
 	int irq = (int) cookie;		/* IRQ we're handling */
+	static int straycount[NHWI];	/* count of stray IRQs */
 	struct ithd *ir = ithds[irq];	/* and the process that does it */
 
 	/* This used to be in icu_vector.s */
@@ -144,6 +147,21 @@
 	}
 #endif
 		
+	/* XXX: quick fix to avoid page fault until this is done properly. */
+	if (ir == NULL) {
+		if (irq < NHWI) {
+			if (straycount[irq] < MAX_STRAY_LOG) {
+				printf("stray irq %d\n", irq);
+				if (++straycount[irq] == MAX_STRAY_LOG)
+					printf("got %d stray irq %d's: "
+					  "not logging anymore\n",
+					  MAX_STRAY_LOG, irq);
+			}
+			return;
+		}
+		panic("sched_ithd: ithds[%d] == NULL", irq);
+	}
+
 	/*
 	 * Set it_need so that if the thread is already running but close
 	 * to done, it will do another go-round.  Then get the sched lock

--Ls2Gy6y7jbHLe9Od--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000914233231.N77593>