From owner-freebsd-current@FreeBSD.ORG Tue Aug 17 05:15:03 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 0C47116A4CE for ; Tue, 17 Aug 2004 05:15:03 +0000 (GMT) Received: from smtp003.bizmail.yahoo.com (smtp003.bizmail.yahoo.com [216.136.130.195]) by mx1.FreeBSD.org (Postfix) with SMTP id D96EE43D5C for ; Tue, 17 Aug 2004 05:15:02 +0000 (GMT) (envelope-from noackjr@alumni.rice.edu) Received: from unknown (HELO optimator.noacks.org) (noackjr@supercrime.org@70.240.234.183 with login) by smtp003.bizmail.yahoo.com with SMTP; 17 Aug 2004 05:15:02 -0000 Received: from localhost (localhost [127.0.0.1]) by optimator.noacks.org (Postfix) with ESMTP id 8BEA261AA; Tue, 17 Aug 2004 00:15:01 -0500 (CDT) Received: from optimator.noacks.org ([127.0.0.1]) by localhost (optimator.noacks.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 51742-01; Tue, 17 Aug 2004 00:14:59 -0500 (CDT) Received: from compgeek.noacks.org (compgeek [192.168.1.10]) by optimator.noacks.org (Postfix) with ESMTP id B968261A4; Tue, 17 Aug 2004 00:14:59 -0500 (CDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by compgeek.noacks.org (8.13.1/8.13.1) with ESMTP id i7H5EqfP052384; Tue, 17 Aug 2004 00:14:54 -0500 (CDT) (envelope-from noackjr@alumni.rice.edu) Message-ID: <4121944C.5060802@alumni.rice.edu> Date: Tue, 17 Aug 2004 00:14:52 -0500 From: Jon Noack User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040806) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Julian Elischer References: <20040813121208.M31181@cvs.imp.ch> <20040813102922.E93695@carver.gumbysoft.com> <411D20DF.2000503@samsco.org> <411E9399.3050200@alumni.rice.edu> <411EF85A.30006@elischer.org> In-Reply-To: <411EF85A.30006@elischer.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at noacks.org cc: Martin Blapp cc: freebsd-current@freebsd.org Subject: Re: Deadlocks with recent SMP current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: noackjr@alumni.rice.edu List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Aug 2004 05:15:03 -0000 On 08/15/04 00:44, Julian Elischer wrote: > Jon Noack wrote: >> On 08/13/04 15:13, Scott Long wrote: >>> Can you try the patch below? It's really only a band-aid, but might >>> make things usable for now. Also, are more lockups being seen under >>> ULE or under 4BSD. There was a recent change to ULE (rev 1.120 of >>> sched_ule.c) that seems to have aggrivated the scheduler problems on >>> my test systems. >>> >>> Scott >>> >>> Index: kern_switch.c >>> =================================================================== >>> RCS file: /usr/ncvs/src/sys/kern/kern_switch.c,v >>> retrieving revision 1.78 >>> diff -u -r1.78 kern_switch.c >>> --- kern_switch.c 10 Aug 2004 00:26:25 -0000 1.78 >>> +++ kern_switch.c 13 Aug 2004 20:11:27 -0000 >>> @@ -345,6 +345,8 @@ >>> return; >>> } >>> >>> + critical_enter(); >>> + >>> tda = kg->kg_last_assigned; >>> if ((ke = td->td_kse) == NULL) { >>> if (kg->kg_idle_kses) { >>> @@ -441,6 +443,7 @@ >>> CTR3(KTR_RUNQ, "setrunqueue: held: td%p kg%p pid%d", >>> td, td->td_ksegrp, td->td_proc->p_pid); >>> } >>> + critical_exit(); >>> } >>> >>> /* >> >> Here's a data point: >> My dual Pentium3 system has been up for 20+ hours with this patch. >> Previously, it wouldn't survive for more than an hour or so >> (regardless of load). > > try the following change instead: > in maybe_preempt() in kern_switch.c > > ctd = curthread; > + if ((ctd->td_kse == NULL) || (ctd->td_kse->ke_thread != ctd)) > + return (0); > pri = td->td_priority; With the previous patch I still had difficulties getting through a buildworld in multi-user (while running apache, postfix+amavisd-new, nfs, etc.). With this patch I have not run into any issues (make -j4 buildworlds are stable on my dual p3 even after uncommenting -DUSE_KQUEUE and rebuilding make). If the last patch was a bandaid, this is one of those new-fangled "sport" bandaids that are water- and sweat-resistent... ;-) Jon