From owner-freebsd-threads@FreeBSD.ORG Wed Nov 17 19:40:21 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C8E7C16A4CE for ; Wed, 17 Nov 2004 19:40:21 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6506243D45 for ; Wed, 17 Nov 2004 19:40:21 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) iAHJeHZ1027182; Wed, 17 Nov 2004 14:40:18 -0500 (EST) Date: Wed, 17 Nov 2004 14:40:17 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Petri Helenius In-Reply-To: <419BA6BA.4060304@he.iki.fi> 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: freebsd-threads@freebsd.org Subject: Re: mutex performance X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2004 19:40:21 -0000 On Wed, 17 Nov 2004, Petri Helenius wrote: > Daniel Eischen wrote: > > >On Wed, 17 Nov 2004, Petri Helenius wrote: > > > >>Do you feel that mutex performance could be improved from the current > >>2-3 million lock/unlock operations per second on uncontested mutexes on > >>~2.4Ghz prescott? Which seems to be about 1000 cycles per lock/unlock. [ ... ] > And I'm wondering how much I need to engineer around mutexes or holding > them for longer and releasing just before yielding. I'm not saying it > should/must be better, just trying to ask for the feel where to go. It should get better, so... > >I want to change libpthread locks to drop the 80386 support > >and just use the atomic primitives for default mutex types. > >In 6.0, we'll also change all the mutexes, CVs, and semaphores > >so they aren't pointers -- that will save an indirection and > >also allow them to be process shared. > > > Do you have patches or is this on planning stage? Just planning. The change from pointer type to structure is a big change; it breaks the ABI and affects libc, libthr, libpthread, libc_r (if we keep it around in 6.0). Changing our current low-level locks to use the atomic functions is less intrusive and will be done first. -- DE