From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 21 23:36:01 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C39B106566B; Wed, 21 Jan 2009 23:36:00 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 2397D8FC12; Wed, 21 Jan 2009 23:35:59 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id n0LNZuuV020739; Wed, 21 Jan 2009 18:35:57 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.0 (mail.netplex.net [204.213.176.10]); Wed, 21 Jan 2009 18:35:57 -0500 (EST) Date: Wed, 21 Jan 2009 18:35:56 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Brian Fundakowski Feldman In-Reply-To: <20090121230033.GC12007@green.homeunix.org> Message-ID: References: <20090109031942.GA2825@green.homeunix.org> <20090109053117.GB2825@green.homeunix.org> <4966F81C.3070406@elischer.org> <20090109163426.GC2825@green.homeunix.org> <49678BBC.8050306@elischer.org> <20090116211959.GA12007@green.homeunix.org> <49710BD6.7040705@FreeBSD.org> <20090120004135.GB12007@green.homeunix.org> <20090121230033.GC12007@green.homeunix.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: hackers@freebsd.org, Jason Evans , Julian Elischer Subject: Re: threaded, forked, rethreaded processes will deadlock X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 23:36:01 -0000 On Wed, 21 Jan 2009, Brian Fundakowski Feldman wrote: > On Mon, Jan 19, 2009 at 07:41:35PM -0500, Brian Fundakowski Feldman wrote: >> On Fri, Jan 16, 2009 at 02:36:06PM -0800, Jason Evans wrote: >>> Brian Fundakowski Feldman wrote: >>> > Could you, and anyone else who would care to, check this out? It's a >>> regression >>>> fix but it also makes the code a little bit clearer. Thanks! >>>> >>>> Index: lib/libc/stdlib/malloc.c >>> >>> Why does malloc need to change for this? Unless there's a really good >>> reason, I don't want the extra branches in the locking functions. >> >> Because malloc is the thing causing the regression. It is easy enough >> to optimize out the one extra fetch and branch in the single-threaded case >> if I can get some consensus that the fix to it is actually fine. The changes to thr_fork.c seem gratuituous; they don't affect any functionality, and I don't see the difference between the flag saying "unlock the malloc mutex" or "I was threaded". Clearly, it is set in "if (__isthreaded)", so it is obvious that it indeed was threaded. I can't speak to the malloc changes... -- DE