Date: Mon, 10 Sep 2007 20:18:50 +1000 From: Peter Jeremy <peterjeremy@optushome.com.au> To: Peter Wemm <peter@wemm.org> Cc: freebsd-amd64@freebsd.org Subject: Re: amd64 process sizes Message-ID: <20070910101850.GA1146@turion.vk2pj.dyndns.org> In-Reply-To: <46E38930.2050409@wemm.org> References: <20070905095049.GH1167@turion.vk2pj.dyndns.org> <20070905145006.GA50486@team.vega.ru> <46E38930.2050409@wemm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2007-Sep-08 22:48:32 -0700, Peter Wemm <peter@wemm.org> wrote: >1) binutils has the wrong max page size. It is currently set at 1MB rathe= r=20 >than 2MB. I believe this is fixed in binutils sources that we have not=20 >imported yet. This is currently harmless, but is less than useful once we= =20 >have superpages support committed. I can see the usefulness of superpages for large objects (like the kernel and database buffer caches) but do they actually have much benefit for normal executables and shared libraries? Looking through my set of .so's, I only have 6 that have text segments larger than 2MiB (though a 7th is close to 2MiB), the largest (libwx_gtk2) is only 5MiB. None of the data or bss segments are larger than 2MiB and (the largest is 1.8MiB). I notice that the i386 ld scripts don't bother with superpage alignments. >2) There is a bug in sys/kern/imgact_elf.c. It assumes that the PT_LOAD= =20 >sections are contiguous, which isn't a given. I've had a quick look through all my process maps and I don't see any obvious issues with imgact_elf.c - it looks to be only ld-elf.so.1. >process size by eliminating the unnecessary mappings. I'll take a look an= d=20 >see if I can fix it. If somebody else wants to take a shot, be my guest. The biggest difficulty I see is that currently ld-elf.so just mmap()s the various bits of the requested .so - any alignment is totally up to mmap(2). There is no way to request anything other than page alignment. I can see potential uses for a "MAP_ALIGN" flag to mmap(2) which would treat "addr" as an minimum alignment but no other Unices appear to support this. The only other option I can see would be for ld-elf.so to second-guess the way mmap(2) works and use a mixture of MAP_FIXED and mmap()/munmap() to achieve the required alignment. --=20 Peter Jeremy --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFG5RoK/opHv/APuIcRAhgMAJ9acX+/6QTnyOXwwUCBwzEVL9YuTACgwWU9 4ZsqBGDWMv9V/fb/g29RVaE= =REOR -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070910101850.GA1146>