From owner-cvs-src@FreeBSD.ORG Tue Jun 12 18:57:38 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D43F316A41F; Tue, 12 Jun 2007 18:57:38 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id 9594113C487; Tue, 12 Jun 2007 18:57:38 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.101] (c-71-231-138-78.hsd1.or.comcast.net [71.231.138.78]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id l5CIuDt4050260 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Tue, 12 Jun 2007 14:56:14 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Tue, 12 Jun 2007 11:55:40 -0700 (PDT) From: Jeff Roberson X-X-Sender: jroberson@10.0.0.1 To: Sam Leffler In-Reply-To: <466EBECC.3000802@errno.com> Message-ID: <20070612115310.C60816@10.0.0.1> References: <200706120724.l5C7Olwd088327@repoman.freebsd.org> <466EBECC.3000802@errno.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: cvs-src@FreeBSD.org, Jeff Roberson , src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys proc.h src/sys/kern kern_thread.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2007 18:57:38 -0000 On Tue, 12 Jun 2007, Sam Leffler wrote: > Jeff Roberson wrote: >> jeff 2007-06-12 07:24:47 UTC >> >> FreeBSD src repository >> >> Modified files: >> sys/sys proc.h sys/kern kern_thread.c >> Log: >> Solve a complex exit race introduced with thread_lock: >> - Add a count of exiting threads, p_exitthreads, to struct proc. >> - Increment p_exithreads when we set the deadthread in thread_exit(). >> - When we thread_stash() a deadthread use an atomic to drop the count. >> - Spin until the p_exithreads count reaches 0 in thread_wait(). >> - Lock the last exiting thread momentarily to be certain that it has >> exited cpu_throw(). >> - Restructure thread_wait(). It does not need a loop as there will only >> ever be one thread. > > What are the symptoms of this race? Since the sched lock changes I've > repeatedly hit user-after-free crashes and other data corruption-like assert > failures that appear to trigger through signals and exit. These are all on > UP (laptops). I hadn't heard of these problems. This race is not possible on UP. On MP you could have had a NULL deref in cpu_throw(). UP should have been relatively unchanged as a result of threadlock and was tested under heavy load. Can you describe the problems you're seeing in any further detail? Thanks, Jeff > > Sam >