Make rtld use read(2) instead of mmap(2) for ELF headers. This results
in one fewer syscall per shared object. It's similar to Linux behaviour.
On amd64 it results in a rather trivial performance gain - ~0.1% faster
time for a binary that's linked against five libraries and doesn't do
much otherwise.
Details
Details
- Reviewers
kib
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 12826 Build 13090: arc lint + arc unit
Event Timeline
Comment Actions
Using read means that the you use twice as much memory, and due to the malloc() internals, the allocated memory is not returned to the system. Mmaped page is remapped when the text is mapped, and de-facto prefaulted.
Comment Actions
Why twice?
As for returning the memory - yup, it's additional 4kB of swap per process. Still, I believe the relative overhead of the calls to munmap(2) removed is larger.