From owner-freebsd-current@FreeBSD.ORG Mon Dec 12 05:58:40 2005 Return-Path: X-Original-To: current@freebsd.org 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 B8CCE16A41F for ; Mon, 12 Dec 2005 05:58:40 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id E334B43D67 for ; Mon, 12 Dec 2005 05:58:39 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id jBC5wQlB012762; Mon, 12 Dec 2005 00:58:26 -0500 (EST) Date: Mon, 12 Dec 2005 00:58:25 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Jason Evans In-Reply-To: <9FAD2B4B-C167-42D7-A8E7-BE03F4C07543@canonware.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: Johan Bucht , current@freebsd.org Subject: Re: New libc malloc patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2005 05:58:40 -0000 On Sun, 11 Dec 2005, Jason Evans wrote: > On Dec 11, 2005, at 5:48 PM, Johan Bucht wrote: > > > * Locking primitive > > The biggest issue and as David Xu pointed out is probably the locking > > primitives. The SPINLOCK use has a limit in the threading library and > > makes is hard to have a lot of mutexes. I ended up using a wrapper > > around the umtx_lock function to get recursive mutexes and it would > > probably be better to extend the umtx functions to handle recursion. > > This would probably also be appreciated by other malloc > > implementations. > > Might be interesting to implement some of the ideas from the Linux > > futex > > implementation to help umtx. > > I have been contemplating creating a separate spinlock API that > doesn't require the threads library to track the spinlocks across > fork. This would (if I understand correctly) remove the current > static spinlock limitations. What about using pthread_atfork()? > As for supporting recursive spinlocks, I doubt that the overhead > would be acceptable in general. If I could get rid of the need for > the one recursive lock in malloc.c, I certainly would. =) Why do we need a recursive mutex? Can you not restructure the code so that it is not needed? -- DE