From owner-freebsd-current Sun Sep 10 18:45:38 2000 Delivered-To: freebsd-current@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id E3F0137B422 for ; Sun, 10 Sep 2000 18:45:31 -0700 (PDT) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=root) by scientia.demon.co.uk with esmtp (Exim 3.16 #1) id 13YI67-0000Pd-00; Mon, 11 Sep 2000 02:09:23 +0100 Received: (from ben@localhost) by strontium.scientia.demon.co.uk (8.9.3/8.9.3) id CAA85378; Mon, 11 Sep 2000 02:09:23 +0100 (BST) (envelope-from ben) Date: Mon, 11 Sep 2000 02:09:22 +0100 From: Ben Smithurst To: Greg Lehey Cc: Mike Meyer , current@FreeBSD.ORG Subject: Re: page fault in sched_ithd Message-ID: <20000911020922.R77593@strontium.scientia.demon.co.uk> References: <20000909195525.E77593@strontium.scientia.demon.co.uk> <20000909210619.F77593@strontium.scientia.demon.co.uk> <14779.6851.88867.359611@guru.mired.org> <20000911094245.A19199@wantadilla.lemis.com> <20000911015427.Q77593@strontium.scientia.demon.co.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="IU5/I01NYhRvwH70" Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000911015427.Q77593@strontium.scientia.demon.co.uk> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --IU5/I01NYhRvwH70 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Ben Smithurst wrote: > Greg Lehey wrote: > >> Sorry, I missed the beginning of this. Could somebody send me the >> patch? I'd assume that a relatively simple check would handle the >> issue, based on what I've seen here. > > I've lost the actual patch, I basically just added > > if (ir == NULL) > return; > > in sched_ithd() before it ever de-references ir. I've some up with a > slightly bigger patch which adds stray IRQ logging too, but I haven't > tested that yet. Here's the slightly bigger patch, which seems to be working fine so far. -- Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D --IU5/I01NYhRvwH70 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.1 diff -u -r1.1 ithread.c --- ithread.c 2000/09/07 01:32:48 1.1 +++ ithread.c 2000/09/10 12:57:59 @@ -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. @@ -104,6 +106,7 @@ { int irq = (int) cookie; /* IRQ we're handling */ ithd *ir = ithds[irq]; /* and the process that does it */ + static int straycount[NHWI]; /* This used to be in icu_vector.s */ /* @@ -144,6 +147,20 @@ } #endif + 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 --IU5/I01NYhRvwH70-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message