From owner-freebsd-current Wed Feb 7 16:41:39 2001 Delivered-To: freebsd-current@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id D0EE337B4EC for ; Wed, 7 Feb 2001 16:41:20 -0800 (PST) Received: from foo.osd.bsdi.com (root@foo.osd.bsdi.com [204.216.28.137]) by pike.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id f180eax21380; Wed, 7 Feb 2001 16:40:36 -0800 (PST) (envelope-from jhb@foo.osd.bsdi.com) Received: (from jhb@localhost) by foo.osd.bsdi.com (8.11.1/8.11.1) id f180eDD15628; Wed, 7 Feb 2001 16:40:13 -0800 (PST) (envelope-from jhb) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20010207235459.B534@webcom.it> Date: Wed, 07 Feb 2001 16:40:13 -0800 (PST) Organization: BSD, Inc. From: John Baldwin To: Andrea Campi Subject: Re: Kernel Panic from Yesterday's CVSup Cc: current@FreeBSD.org, "Crist J. Clark" , Jim Bloom Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 07-Feb-01 Andrea Campi wrote: > On Wed, Feb 07, 2001 at 02:20:43PM -0800, John Baldwin wrote: >> >> On 07-Feb-01 Andrea Campi wrote: >> > Running a kernel I got with this: >> > >> >> >> >> cvs co -D"2001-01-30" src/sys >> >> >> > >> > /ithread.c/1.10/Mon Dec 4 21:15:14 2000//D2001.01.29.23.00.00 >> > >> > I get: >> > >> > panic: malloc(M_WAITOK) in interrupt context >> > Debugger("panic") >> > Stopped at Debugger+0x45: pushl %ebx >> > db> trace >> > Debugger(c02119a3) at Debugger+0x45 >> > panic(....) >> > malloc(48,c0238100,0,c65feb80,0) at malloc+0x2a >> > exit1(c65feb80,0,0,c6623f78,c01fc852) at exit1+0x1b1 >> > kthread_suspend(0,c0279a40,0,c022d1ec,a2) at kthread_suspend >> > ithd_loop(0,c6623fa8) at ithd_loop+0x56 >> > fork_exit(c01fc7fc,0,c6623fa8) at fork_exit+0x8 >> > fork_trampoline() at fork_trampoline+0x8 >> > db> witness_list >> > "Giant" (0xc0279a40) locked at ../../i386/isa/ithread.c:162 >> >> Erm, ithd_loop() doesn't call kthread_suspend(). *sigh*. Something >> else is rather messed up here I'm afraid. > > So I thought... also, kthread_suspend() doesn't call exit1(), does it? > > > No matter what, ithd_loop() calls kthread_exit() which calls exit1() > which happily MALLOC's with M_WAITOK... > Something is messed up, indeed, but it seems to be a case of WISIWYG instead > of what I mean... ;-) > > > Also, I think this issue has been there longer but it might have been masked > by me not having INVARIANTS defined at times (am I correct to read the code > as > not panicing #ifndef INVARIANTS?). So I am going back before this revision: > > revision 1.78 > date: 2001/01/21 19:25:07; author: jake; state: Exp; lines: +3 -2 > Make intr_nesting_level per-process, rather than per-cpu. Setup > interrupt threads to run with it always >= 1, so that malloc can > detect M_WAITOK from "interrupt" context. This is also necessary > in order to context switch from sched_ithd() directly. Yes, the intr_nesting_level needs to be dropped before calling kthread_exit(). I have this fixed in a different manner locally. You can try that to see if it gets farther. However, your problems with lpr are a known problem and one that is in the process of being fixed. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message