From owner-freebsd-current@FreeBSD.ORG Wed Oct 13 18:40:26 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0839116A4CE for ; Wed, 13 Oct 2004 18:40:26 +0000 (GMT) Received: from duchess.speedfactory.net (duchess.speedfactory.net [66.23.201.84]) by mx1.FreeBSD.org (Postfix) with SMTP id 61BE043D46 for ; Wed, 13 Oct 2004 18:40:25 +0000 (GMT) (envelope-from ups@tree.com) Received: (qmail 5188 invoked by uid 89); 13 Oct 2004 18:40:24 -0000 Received: from duchess.speedfactory.net (66.23.201.84) by duchess.speedfactory.net with SMTP; 13 Oct 2004 18:40:24 -0000 Received: (qmail 5159 invoked by uid 89); 13 Oct 2004 18:40:24 -0000 Received: from unknown (HELO palm.tree.com) (66.23.216.49) by duchess.speedfactory.net with SMTP; 13 Oct 2004 18:40:24 -0000 Received: from [127.0.0.1] (localhost.tree.com [127.0.0.1]) by palm.tree.com (8.12.10/8.12.10) with ESMTP id i9DIeNmt097653; Wed, 13 Oct 2004 14:40:23 -0400 (EDT) (envelope-from ups@tree.com) From: Stephan Uphoff To: Giorgos Keramidas In-Reply-To: <20041013173149.GA40026@orion.daedalusnetworks.priv> References: <20041013114140.GA613@orion.daedalusnetworks.priv> <20041013173149.GA40026@orion.daedalusnetworks.priv> Content-Type: multipart/mixed; boundary="=-/DPmZtXeu3s177d98tmB" Message-Id: <1097692823.90332.1654.camel@palm.tree.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 13 Oct 2004 14:40:23 -0400 cc: freebsd-current@freebsd.org Subject: Re: Oct 13 spontaneous reboot X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2004 18:40:26 -0000 --=-/DPmZtXeu3s177d98tmB Content-Type: text/plain Content-Transfer-Encoding: 7bit My fault - I am currently testing a fix. This is a bug if SMP is not defined in the config file. As a work around you can either define SMP or try the attached patch. Stephan On Wed, 2004-10-13 at 13:31, Giorgos Keramidas wrote: > On 2004-10-13 14:41, Giorgos Keramidas wrote: > > I had updated my source tree yesterday afternoon and everything worked. > > Today's CURRENT spontaneously reboots every time I try to start firefox. > > > > I have KDB in my kernel config and I can enter the debugger before I > > start X11 with CTRL-ALT-ESC, but when firefox starts the next thing > > that's visible on my screen is the BIOS startup. > > > > I'll try narrowing down this to a specific time since yesterday noon, by > > updating my sources to '2004/10/12 12:00:00 UTC' which was the last > > version I know that worked and move in steps up to today's CURRENT, but > > I just wanted to let everyone know that something seems very broken here. > > The kernel as of -D '2004/10/12 12:00:00' works fine. > > I have a faint suspicion that these two commits are the cause of the > instant reboots that firefox triggers on uniprocessor machines. I'm > building a kernel now updated with the sources of: > > -D '2004/10/12 16:47:00' > > and revision 1.100 of src/sys/kern/kern_switch.c that phk committed a > few hours later. > > - Giorgos > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > > --=-/DPmZtXeu3s177d98tmB Content-Disposition: attachment; filename=oct13_patch Content-Type: text/x-patch; name=oct13_patch; charset=ASCII Content-Transfer-Encoding: 7bit Index: kern_switch.c =================================================================== RCS file: /cvsroot/src/sys/kern/kern_switch.c,v retrieving revision 1.100 diff -u -r1.100 kern_switch.c --- kern_switch.c 12 Oct 2004 20:57:37 -0000 1.100 +++ kern_switch.c 13 Oct 2004 17:21:11 -0000 @@ -326,11 +326,45 @@ * it should switch threads. */ + +#if !defined(SMP) +static void +maybe_preempt_in_ksegrp(struct thread *td) +{ + struct thread *running_thread; + +#ifndef FULL_PREEMPTION + int pri; + pri = td->td_priority; + if (!(pri >= PRI_MIN_ITHD && pri <= PRI_MAX_ITHD)) + return; +#endif + mtx_assert(&sched_lock, MA_OWNED); + running_thread = curthread; + + if (running_thread->td_ksegrp != td->td_ksegrp) + return; + + if (td->td_priority > running_thread->td_priority) + return; +#ifdef PREEMPTION + if (running_thread->td_critnest > 1) + running_thread->td_pflags |= TDP_OWEPREEMPT; + else + mi_switch(SW_INVOL, NULL); + +#else + running_thread->td_flags |= TDF_NEEDRESCHED; +#endif + return; +} + +#else /* SMP */ + static void maybe_preempt_in_ksegrp(struct thread *td) { struct thread *running_thread; -#if defined(SMP) int worst_pri; struct ksegrp *kg; cpumask_t cpumask,dontuse; @@ -403,12 +437,6 @@ } #endif -#else - running_thread = curthread; - KASSERT(running_thread->td_ksegrp == td->td_ksegrp, - ("maybe_preempt_in_ksegrp: No chance to run thread")); -#endif - if (td->td_priority > running_thread->td_priority) return; #ifdef PREEMPTION @@ -422,6 +450,8 @@ #endif return; } +#endif /* !SMP */ + int limitcount; void --=-/DPmZtXeu3s177d98tmB--