Prebind from OpenBSD

Robert Watson rwatson at FreeBSD.org
Sun Mar 27 19:54:19 UTC 2011


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...

Robert


More information about the freebsd-hackers mailing list