Possible fix for KSE threads that never wake up

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Tue, 12 Oct 2004 15:56:51 -0400
Currently the KSE code arbitrarily sets the SLEEPING inhibitor on any thread 
it suspends that is on the sleep queue.  Threads that are on the sleep queue 
however are not always asleep and it adds needless complication and 
opportunity for bugs (if the inhibitor is not otherwise cleared the thread 
may never get to run again).  Since the suspension code uses its own 
inhibitor the hack isn't even needed.  This patch just turns it off.  Let me 
know if this fixes any problems people are seeing:

--- //depot/projects/smpng/sys/kern/kern_thread.c	2004/10/12 19:09:56
+++ //depot/user/jhb/preemption/kern/kern_thread.c	2004/10/12 19:26:23
_at__at_ -999,6 +999,7 _at__at_
 	p->p_suspcount++;
 	TD_SET_SUSPENDED(td);
 	TAILQ_INSERT_TAIL(&p->p_suspended, td, td_runq);
+#if 0
 	/*
 	 * Hack: If we are suspending but are on the sleep queue
 	 * then we are in msleep or the cv equivalent. We
_at__at_ -1007,6 +1008,7 _at__at_
 	 */
 	if (TD_ON_SLEEPQ(td))
 		TD_SET_SLEEPING(td);
+#endif
 }
 
 void

-- 
John Baldwin <jhb_at_FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Received on Tue Oct 12 2004 - 17:56:29 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:17 UTC