From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 59EC1198005 for ; Tue, 26 Feb 2013 13:34:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0E7E0E0676; Tue, 26 Feb 2013 13:34:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 11E5DE062B for ; Tue, 26 Feb 2013 13:34:05 +0000 (UTC) Received: from [192.168.1.2] (pool-173-77-245-118.nycmny.fios.verizon.net [173.77.245.118]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: ryao) by smtp.gentoo.org (Postfix) with ESMTPSA id D792A33DEA4 for ; Tue, 26 Feb 2013 13:34:04 +0000 (UTC) Message-ID: <512CB9B8.9060308@gentoo.org> Date: Tue, 26 Feb 2013 08:33:44 -0500 From: Richard Yao User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121128 Thunderbird/10.0.11 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: "gentoo-dev@lists.gentoo.org" Subject: [gentoo-dev] Evaluating a new malloc() X-Enigmail-Version: 1.3.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig624AD9BE847F65ADAE397897" X-Archives-Salt: 23ca5780-3f65-4410-bbe6-eef030cc63ff X-Archives-Hash: b2c4c8a093fe0194399359c031f383f2 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig624AD9BE847F65ADAE397897 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable The Blender project found some fairly remarkable discrepancies between what their software actually used and what glibc's ptmalloc allocated: http://www.sintel.org/development/memory-jemalloc/ Results such as these led Blender and others (e.g. Chrome/Chromium, Firefox, Thunderbird) to bundle private versions of jemalloc. This bundling situation violates our policy against bundled libraries. The maintainers could just patch their software to link to libjemalloc. However, it might make more sense to evaluate jemalloc as a distribution-wide replacement for glibc's ptmalloc. It appears that run the following commands on amd64 to see how jemalloc works when used system-wide: echo dev-libs/jemalloc ~amd64 >> /etc/portage/package.accept_keywords emerge dev-libs/jemalloc echo /usr/lib64/libjemalloc.so.1 >> /etc/ld.so.preload I did this on my system, verified that jemalloc was being loaded with strace and rebooted. So far, sudo is broken and anything that is 32-bit will have the loader print an error about the library not being preloaded. On a related note, setuid binaries will obey /etc/ld.so.preload, even though they ignore LD_PRELOAD. There is a chance that patching jemalloc directly into glibc would solve the sudo issue, but I imagine that sudo is doing something strange, which likely merits attention. For now, I am using su as a substitute until I look into why sudo is broken. Unless a significant issue is found in jemalloc itself, I do not see any reason to continue using glibc's ptmalloc over jemalloc. As far as I know, FreeBSD, NetBSD, Facebook and others are using jemalloc, so I expect that no significant issues will be found. jemalloc will still needs testing before we can consider it. Doing good tests is hard, so I would like to crowd source ideas on the appropriate way to test a malloc implementation from the list. My expectation is that people on the list will collectively think of better ideas than I could on my own. With that said, what do people think? --------------enig624AD9BE847F65ADAE397897 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJRLLm4AAoJECDuEZm+6Exks7YQAJ0dGzxbYVKpOnnavVFtny9k ZcKtmtSf/T+UhekKa+OcNO4oXgQbPLDzDXJPIzIAKVcxgvF985roVFtBok8+6Y/G 0NZSxEzzrqwQg6GIsm49hWDTqXC3JwkebWr4/w+XhIGNPQRdK6/l0JiYlvCjhd15 9tmlw/xJFX/yPIDhHMkrQR0+/sWDIxwerGMxuxF3/kcOu1rcCOooLHrI8PUwQl6y gMOHWi8HHYNvQHtyV/l2VWC4IVqNUZex9PG9PghutMuJQrPGeTs7/iN4rCZxyLA2 UG29xrFWvIOY4G4VwX3jdMlk2j0aEo7PEJhR1THq88fWyHwpjyCGBvropVU2KEHT 2Yr3BhwFLlO9u3NvueKLTCG1D3tNrSbtxxx6wrtpqNme504dchAhShVNPyjgeKp1 WDGmCHhTG2shMTISnNdUD4AJGpgSaubYxO1it5/jk1FVdyPRaZAWELtRZQS0L/0g MYZXP+OVz/Aa3/J48AMvyWoHkTB1bC+JO1BGqCvYlIyokaOao92wKWnHIeWxunYJ RI1GPIXKz1fyAFue7xiJIQEIPCqoPfC9E+vN21hhrf/rd9NGwNWe5dEVTotpvBNk kXRPiIf8wI2A4XFTZScoq1NcUD+Vy4acfjmbMYwoj6XtDEiMCapH/t7F0bVb7BCZ xMedpKYnm3dyL9t4eP1o =H+uM -----END PGP SIGNATURE----- --------------enig624AD9BE847F65ADAE397897--