From owner-cvs-all@FreeBSD.ORG Tue Jun 12 15:41:49 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8269B16A468; Tue, 12 Jun 2007 15:41:49 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 4E7F413C4BF; Tue, 12 Jun 2007 15:41:49 +0000 (UTC) (envelope-from sam@errno.com) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id l5CFfm7h086972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 Jun 2007 08:41:49 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <466EBECC.3000802@errno.com> Date: Tue, 12 Jun 2007 08:42:04 -0700 From: Sam Leffler User-Agent: Thunderbird 2.0.0.0 (X11/20070530) MIME-Version: 1.0 To: Jeff Roberson References: <200706120724.l5C7Olwd088327@repoman.freebsd.org> In-Reply-To: <200706120724.l5C7Olwd088327@repoman.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.org, 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2007 15:41:49 -0000 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). Sam