|
|
Subscribe / Log in / New account

Is pre-linking worth it?

Is pre-linking worth it?

Posted Jul 16, 2009 3:35 UTC (Thu) by nix (subscriber, #2304)
In reply to: Is pre-linking worth it? by tbird20d
Parent article: Is pre-linking worth it?

Yes, but even so, 20% is a terribly high figure. The test program must
have called a very large number of symbols per text page for this to be
true. (Possibly it was a very small test binary, /bin/cat or something
like that: the essentially random ordering of symbols in glibc would have
required many of its pages to be faulted in for relocation processing,
leading to an artificially high figure.)


to post comments

Is pre-linking worth it?

Posted Jul 16, 2009 4:35 UTC (Thu) by arjan (subscriber, #36785) [Link] (2 responses)

this wasn't a test program; it was a whole OS boot + login into the UI/desktop.

Is pre-linking worth it?

Posted Jul 16, 2009 4:39 UTC (Thu) by arjan (subscriber, #36785) [Link]

(and yes, I was surprised by how much it was as well, but it made it a no-brainer to turn on for us)

Is pre-linking worth it?

Posted Jul 23, 2009 16:57 UTC (Thu) by jgg (subscriber, #55211) [Link]

I've got similar results from some of my embedded work too. prelinking saves about 3-5% of system ram in my cases because it prevents paging in of the relocation and symbol tables, and it doesn't dirty as many pages in the shared libraries.

20% doesn't seem that surprising to me, glibc for instance has 50k you have to load just to do symbol resolution. You'd only need to fault in 250k of text from glibc to get to 20% overhead. Even my desktop has only faulted in 224kb of glibc.

Is pre-linking worth it?

Posted Jul 16, 2009 11:22 UTC (Thu) by mjthayer (guest, #39183) [Link] (1 responses)

Perhaps because the pre-linking made it unnecessary to open certain on-disk library files to do the symbol look ups, putting that off until symbols from them were actually needed? Just a guess.

Is pre-linking worth it?

Posted Jul 16, 2009 17:51 UTC (Thu) by nix (subscriber, #2304) [Link]

No, relocations within a given library would happen when that library was
opened: the relocation process cannot trigger additional library opens
that weren't already going to happen.

In any case, most library opens during system startup will be driven by
DT_NEEDED, in which case the whole dependency tree of them gets mmap()ed
immediately.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds