Date: Thu, 10 Nov 2016 23:08:26 +0000 From: Brooks Davis <brooks@freebsd.org> To: Benjamin Kaduk <kaduk@mit.edu> Cc: Matthias Andree <matthias.andree@gmx.de>, freebsd-hackers@FreeBSD.org, Mark Linimon <linimon@lonesome.com> Subject: Re: sbrk(0) replacement for memory resource tracking? (was: [linimon@FreeBSD.org: svn commit: r425823 - in head: benchmarks/stress-ng cad/cider cad/ngspice_rework databases/mariadb100-server databases/mariadb101-server databases/mariadb55-server databases/virtuoso devel/ace deve...]) Message-ID: <20161110230825.GA94990@spindle.one-eyed-alien.net> In-Reply-To: <20161110215549.GL91607@kduck.kaduk.org> References: <20161110012624.GA23701@lonesome.com> <dd964b1d-db3c-94d4-794b-929b28326430@gmx.de> <20161110215549.GL91607@kduck.kaduk.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 10, 2016 at 03:55:50PM -0600, Benjamin Kaduk wrote: > On Thu, Nov 10, 2016 at 10:21:18PM +0100, Matthias Andree wrote: > > Am 10.11.2016 um 02:26 schrieb Mark Linimon: > > > FYI. Unfortunately I do not know what the generic fix is yet. But at > > > least this will prevent the package builders from wasting time right = now. > > >=20 > > > I will try to keep the following page updated as I learn more: > > >=20 > > > https://wiki.freebsd.org/PortsBrokenWithSbrk > > >=20 > > > (oops, I forgot I have not put in the proper logfile URLs yet. Let me > > > get started on that.) > > >=20 > > > mcl > >=20 > > Please help me understand the issue, and if by adding one or two > > introductory paragraphs to the Wiki. >=20 >=20 > Looks like r300303 is the relevant one for aarch64 (RISC-V got a similar = treatment > later?). >=20 > > To me it looks like the sbrk() function is going away from our base > > system underneath a stable 11-* branch. If that is true, I'll have to > > object to that and request sbrk() be put back, we add a deprecation > > notice now (if necessary via errata notice) and pull it only from FreeB= SD12. >=20 > At the time I somehow convinced myself that it had never been in a stable > release and was thus okay, but maybe I'm misremembering. Hmm, or maybe it > is okay for a tier-2 architecture [in the mind of the committer, not nece= ssarly > me, to be clear]. It's never been in a release on either architecture. > > OTOH, e2fsprogs uses only sbrk(0) to track its overall memory use, and > > only to track its resource usage. I'll be happy to help porting to >=20 > Same for zephyr. >=20 > > something else that serves the same purpose, aka "how much memory am I > > using" - but what would that be? >=20 > I think there isn't really a drop-in replacement. N.B. that the number > from sbrk(0) has been meaningless for quite some time, since jemalloc > uses mmap to get more space. As you point out, sbrk(0) does not show memory usage in a useful way for normal programs. If you enable ASR/ASLR it gets even more useless. An implementation that returns NULL should satisfy most code that abuses it for memory use and provide no less value. -- Brooks --VS++wcV0S1rZb1Fb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJYJP3pAAoJEKzQXbSebgfA9REH/2okeLCzM2ySFrUIdyqKTKxa fsYE9JgIpUe8Ay4FHo3Fau3GCjajOYmYWToLZ/Wp+HhRdE+WFbx9hYWaL8/AnI7E 99GDRaCEDUJWsUNYEW5GUJeyNpBsT5M1TMdKPqoOI9VXMrY0pH3nZT2pVVqDVN13 ghOW0RcvWjUeV9UVSSUEs0frXoKxrTz+vAvvLqD11+ifSPoYCUcdtwfUJYWu2Dt6 eKWoBvcvlR1cWI3RoQzHnvnjCmW17XAd52FuJUsOzJPBlFPmEFiBW6zjxXFmXJoJ VGdpQO/gwq+g67GjJL/b7Sx2hBq3xENFJJbIUpz2Ic/Zo31Lj75C7U6ZgB9PEGQ= =O7U5 -----END PGP SIGNATURE----- --VS++wcV0S1rZb1Fb--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161110230825.GA94990>