Prebind from OpenBSD

Kostik Belousov kostikbel at gmail.com
Sun Mar 27 20:04:12 UTC 2011


On Sun, Mar 27, 2011 at 08:54:18PM +0100, Robert Watson wrote:
> On Sat, 26 Mar 2011, Jesse Smith wrote:
> 
> >I'm interested in working on the "Port prebind from OpenBSD" project 
> >mentioned on the FreeBSD Ideas page. ( 
> >http://wiki.freebsd.org/IdeasPage#head-d28cdd95ca1755d5afe63d653cb4926d4bdc99de 
> >)
> >
> >There isn't much to go on from the project description and I'm curious 
> >what FreeBSD devs are looking for specifically. For example, should the 
> >entire ldconfig program be ported from OpenBSD (it looks like it's close 
> >enough to FreeBSD's to make that suitable), or should just the prebind 
> >code be merged into FreeBSD's ldcnfig?
> >
> >Once the project is complete, who should the work be submitted to? Has 
> >anyone else worked on this and made any progress?
> 
> Hi Jesse:
> 
> I think the intent of the ideas list entry is more a research project than 
> a direct-to-commit project: the question is whether prebinding of some sort 
> would observably help performance for important FreeBSD applications or, 
> for example, the boot process.  If so, then certainly the OpenBSD 
> prebinding code is a possible model -- Mac OS X also has prebinding, of 
> course, and it's done quite differently (and probably less reusably from 
> our perspective as they use Mach-O rather than ELF); however, there might 
> be interesting ideas as well.
> 
> I think therefore I'd structure a project along the following lines: first, 
> you want to establish to what extent synchronous waiting on linkage at 
> run-time is a significant problem.  It could be that some combination of 
> hwpmc and DTrace would be the right tools for this.  I'd especially pay 
> attention to boot time, since we know that quite a lot of executing takes 
> place then as part of rc.d.  I'd also investigate large applications like 
> Firefox, Chrome, KDE, Gnome, etc.  KDE already integrates prebinding tricks 
> in its design, but I don't think the others do.
> 
> Next, I'd dig a bit more into the areas where it's hurting performance -- 
> can you add up all the time spent waiting and cut 10 seconds from boot, or 
> 5 seconds from Firefox startup?  Or is the best win going to be .2 seconds 
> in Firefox?  Does the OpenBSD optimisation actually address the problem 
> we're experiencing?  Perhaps perform some experiments with prebinding-like 
> behaviour, working up to an implementation.
> 
> It's worth remembering that prebinding comes with some baggage as well, of 
> course.  Perhaps less relevant in the world of 64-bit address spaces, but 
> there are some design trade-offs in this department...
The most serious issue with prebind is a consistency.
It is very easy to get prebind data out of date, and this is
esp. easy in the FreeBSD where buildworld and source port upgrades
are everyday activity.

Before this goes much further, yes, we need a benchmarks that demonstrate
that system spends significant time in the symbol resolution for often
started images [*], and second, we need to have a workable model for source
upgrades.

* - so that Firefox, OpenOffice etc do not qualify, IMHO.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110327/b7d2c147/attachment.pgp


More information about the freebsd-hackers mailing list