Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Oct 2004 14:40:23 -0400
From:      Stephan Uphoff <ups@tree.com>
To:        Giorgos Keramidas <keramida@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Oct 13 spontaneous reboot
Message-ID:  <1097692823.90332.1654.camel@palm.tree.com>
In-Reply-To: <20041013173149.GA40026@orion.daedalusnetworks.priv>
References:  <20041013114140.GA613@orion.daedalusnetworks.priv> <20041013173149.GA40026@orion.daedalusnetworks.priv>

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

--=-/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 <keramida@freebsd.org> 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--



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