Native preemption is the culprit [was Re: today's CURRENT lockups]

Robert Watson rwatson at freebsd.org
Mon Jul 5 21:15:00 PDT 2004


(This time to more people)

The patch below appears to (brute force) eliminate the crash/hang I'm
experiencing with SCHED_ULE in the post-preemption universe.  However, I
was experiencing it only in the SMP case, not UP, so it could be I'm just
not triggering it timing-wise.  This would be a temporary fix until jhb is
online again post-USENIX to take a look, assuming this works around the
problem for people other than me.

Note that this is probably damaging to interrupt processing latency.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert at fledge.watson.org      Principal Research Scientist, McAfee Research

Index: sched_ule.c
===================================================================
RCS file: /data/ncvs/src/sys/kern/sched_ule.c,v
retrieving revision 1.112
diff -u -r1.112 sched_ule.c
--- sched_ule.c	3 Jul 2004 16:57:51 -0000	1.112
+++ sched_ule.c	6 Jul 2004 02:52:18 -0000
@@ -1623,6 +1623,7 @@
         if (td->td_priority < curthread->td_priority)
                 curthread->td_flags |= TDF_NEEDRESCHED;
 
+#if 0
 #ifdef SMP
 	/*
 	 * Only try to preempt if the thread is unpinned or pinned to the
@@ -1632,6 +1633,7 @@
 #endif
 	if (maybe_preempt(td))
 		return;
+#endif
 	ke->ke_ksegrp->kg_runq_kses++;
 	ke->ke_state = KES_ONRUNQ;
 



More information about the freebsd-current mailing list