From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 27 19:54:19 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 642D3106564A for ; Sun, 27 Mar 2011 19:54:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3FFD48FC15 for ; Sun, 27 Mar 2011 19:54:19 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id D0CA146B43; Sun, 27 Mar 2011 15:54:18 -0400 (EDT) Date: Sun, 27 Mar 2011 20:54:18 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Jesse Smith In-Reply-To: <1301189037.4069.43.camel@hp-laptop> Message-ID: References: <1301189037.4069.43.camel@hp-laptop> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: Prebind from OpenBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2011 19:54:19 -0000 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