From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 27 20:04:12 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 1C2B81065675; Sun, 27 Mar 2011 20:04:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A6D898FC12; Sun, 27 Mar 2011 20:04:11 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p2RK47Qf027561 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 27 Mar 2011 23:04:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p2RK47FL068489; Sun, 27 Mar 2011 23:04:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p2RK47wY068488; Sun, 27 Mar 2011 23:04:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 27 Mar 2011 23:04:07 +0300 From: Kostik Belousov To: Robert Watson Message-ID: <20110327200407.GL78089@deviant.kiev.zoral.com.ua> References: <1301189037.4069.43.camel@hp-laptop> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="erUiqtqS2BgH8+NE" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, Jesse Smith 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 20:04:12 -0000 --erUiqtqS2BgH8+NE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 27, 2011 at 08:54:18PM +0100, Robert Watson wrote: > On Sat, 26 Mar 2011, Jesse Smith wrote: >=20 > >I'm interested in working on the "Port prebind from OpenBSD" project=20 > >mentioned on the FreeBSD Ideas page. (=20 > >http://wiki.freebsd.org/IdeasPage#head-d28cdd95ca1755d5afe63d653cb4926d4= bdc99de=20 > >) > > > >There isn't much to go on from the project description and I'm curious= =20 > >what FreeBSD devs are looking for specifically. For example, should the= =20 > >entire ldconfig program be ported from OpenBSD (it looks like it's close= =20 > >enough to FreeBSD's to make that suitable), or should just the prebind= =20 > >code be merged into FreeBSD's ldcnfig? > > > >Once the project is complete, who should the work be submitted to? Has= =20 > >anyone else worked on this and made any progress? >=20 > Hi Jesse: >=20 > I think the intent of the ideas list entry is more a research project tha= n=20 > a direct-to-commit project: the question is whether prebinding of some so= rt=20 > would observably help performance for important FreeBSD applications or,= =20 > for example, the boot process. If so, then certainly the OpenBSD=20 > prebinding code is a possible model -- Mac OS X also has prebinding, of= =20 > course, and it's done quite differently (and probably less reusably from= =20 > our perspective as they use Mach-O rather than ELF); however, there might= =20 > be interesting ideas as well. >=20 > I think therefore I'd structure a project along the following lines: firs= t,=20 > you want to establish to what extent synchronous waiting on linkage at=20 > run-time is a significant problem. It could be that some combination of= =20 > hwpmc and DTrace would be the right tools for this. I'd especially pay= =20 > attention to boot time, since we know that quite a lot of executing takes= =20 > place then as part of rc.d. I'd also investigate large applications like= =20 > Firefox, Chrome, KDE, Gnome, etc. KDE already integrates prebinding tric= ks=20 > in its design, but I don't think the others do. >=20 > Next, I'd dig a bit more into the areas where it's hurting performance --= =20 > can you add up all the time spent waiting and cut 10 seconds from boot, o= r=20 > 5 seconds from Firefox startup? Or is the best win going to be .2 second= s=20 > in Firefox? Does the OpenBSD optimisation actually address the problem= =20 > we're experiencing? Perhaps perform some experiments with prebinding-lik= e=20 > behaviour, working up to an implementation. >=20 > It's worth remembering that prebinding comes with some baggage as well, o= f=20 > course. Perhaps less relevant in the world of 64-bit address spaces, but= =20 > 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. --erUiqtqS2BgH8+NE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk2PmDcACgkQC3+MBN1Mb4gc6ACfT4DP0q6jrC2iOywJW4A3qxtw Wr8AoLdAg9q7mbr6jnh8Y+7Vo/QUVwc6 =nPgl -----END PGP SIGNATURE----- --erUiqtqS2BgH8+NE--