From owner-freebsd-current@FreeBSD.ORG Tue Oct 12 19:56:29 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 E32D916A54C for ; Tue, 12 Oct 2004 19:56:29 +0000 (GMT) Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id B42E643D3F for ; Tue, 12 Oct 2004 19:56:29 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 4502 invoked from network); 12 Oct 2004 19:56:29 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 12 Oct 2004 19:56:28 -0000 Received: from [10.50.40.210] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i9CJu5ML093602 for ; Tue, 12 Oct 2004 15:56:16 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: current@FreeBSD.org Date: Tue, 12 Oct 2004 15:56:51 -0400 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200410121556.51976.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx Subject: Possible fix for KSE threads that never wake up 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: Tue, 12 Oct 2004 19:56:30 -0000 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 @@ -999,6 +999,7 @@ 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 @@ -1007,6 +1008,7 @@ */ if (TD_ON_SLEEPQ(td)) TD_SET_SLEEPING(td); +#endif } void -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org