From owner-freebsd-performance@FreeBSD.ORG Sat Feb 2 20:49:16 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6853E16A419; Sat, 2 Feb 2008 20:49:16 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id D7B7F13C469; Sat, 2 Feb 2008 20:49:15 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m12KnCS5006593 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 3 Feb 2008 07:49:13 +1100 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.2/8.14.1) with ESMTP id m12KnCDH086893; Sun, 3 Feb 2008 07:49:12 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.2/8.14.2/Submit) id m12KnBPl086892; Sun, 3 Feb 2008 07:49:11 +1100 (EST) (envelope-from peter) Date: Sun, 3 Feb 2008 07:49:11 +1100 From: Peter Jeremy To: Alexander Motin Message-ID: <20080202204911.GT35170@server.vk2pj.dyndns.org> References: <47A25412.3010301@FreeBSD.org> <47A25A0D.2080508@elischer.org> <47A2C2A2.5040109@FreeBSD.org> <20080201185435.X88034@fledge.watson.org> <47A43873.40801@FreeBSD.org> <20080202193656.GR35170@server.vk2pj.dyndns.org> <47A4CAFA.5040708@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Zi0sgQQBxRFxMTsj" Content-Disposition: inline In-Reply-To: <47A4CAFA.5040708@FreeBSD.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.17 (2007-11-01) X-Mailman-Approved-At: Sat, 02 Feb 2008 21:07:09 +0000 Cc: freebsd-hackers@freebsd.org, freebsd-performance@freebsd.org Subject: Re: Memory allocation performance X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Feb 2008 20:49:16 -0000 --Zi0sgQQBxRFxMTsj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 02, 2008 at 09:56:42PM +0200, Alexander Motin wrote: >Peter Jeremy ?????: >> On Sat, Feb 02, 2008 at 11:31:31AM +0200, Alexander Motin wrote: >>> To check UMA dependency I have made a trivial one-element cache which i= n=20 >>> my test case allows to avoid two for four allocations per packet. >>=20 >> You should be able to implement this lockless using atomic(9). I haven't >> verified it, but the following should work. > >I have tried this, but man 9 atomic talks: > >The atomic_readandclear() functions are not implemented for the types >``char'', ``short'', ``ptr'', ``8'', and ``16'' and do not have any=20 >variants with memory barriers at this time. Hmmm. This seems to be more a documentation bug than missing code: atomic_readandclear_ptr() seems to be implemented on most architectures (the only one where I can't find it is arm) and is already used in malloc(3). --=20 Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. --Zi0sgQQBxRFxMTsj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHpNdH/opHv/APuIcRAjglAJ4xNZrFttUitci+60Q+GyVvdziGrQCaAkxf c2uNtF4tELpQ+7FHoc07LLY= =ZYY7 -----END PGP SIGNATURE----- --Zi0sgQQBxRFxMTsj--