From owner-freebsd-current Wed Oct 30 15: 7:27 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6324337B408 for ; Wed, 30 Oct 2002 15:07:25 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB90B43E9C for ; Wed, 30 Oct 2002 15:07:23 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.6) id g9UN7NuC067328; Wed, 30 Oct 2002 17:07:23 -0600 (CST) (envelope-from dan) Date: Wed, 30 Oct 2002 17:07:23 -0600 From: Dan Nelson To: Doug Rabson Cc: Peter Wemm , Terry Lambert , Nate Lawson , current@FreeBSD.ORG Subject: Re: libc size Message-ID: <20021030230723.GE42580@dan.emsphone.com> References: <20021030214158.CB6EA2A88D@canning.wemm.org> <20021030221417.J22480-100000@herring.nlsystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021030221417.J22480-100000@herring.nlsystems.com> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Oct 30), Doug Rabson said: > On Wed, 30 Oct 2002, Peter Wemm wrote: > > We've been over this before. To make this work right, we need to > > make /bin and /sbin dynamically linked. NetBSD's /rescue/* > > approach would solve the "oops!" and other foot shooting problems. > > Yes please. Our root filesystem space requirements are too high, > IMHO. Note that dynamically-linked executables take significantly longer to exec than statically-linked ones. Running the following simple script with getfacl and grep linked dynamically runs a little over twice as slow as with them both static: #! /bin/sh for i in /bin/* /sbin/* /usr/bin/* /usr/sbin/* ; do if ! getfacl "$i" | grep -q owner:0 ; then echo "owner of $i is not root" fi done Static: 3.20r 0.16u 3.59s Dynamic: 6.88r 1.60u 7.03s 3.62r 0.18u 3.50s 6.82r 2.08u 6.56s 3.26r 0.22u 3.52s 6.92r 1.35u 7.26s 3.23r 0.16u 3.62s 7.59r 1.25u 7.48s 3.26r 0.19u 3.65s 7.74r 1.66u 7.42s 3.63r 0.16u 3.76s 7.17r 1.67u 7.15s 6 runs, alternatic static and dynamic scripts for each run. I actually link quite a few binaries in /usr/bin and /usr/sbin static (awk, basename, dirname, find, head, install, sed, tr, uniq, wc). Try this: enable process accounting, run "make fetch-recursive-list" in ports/www/mozilla, then run lastcomm and see how many times tr, sed, basename, sh, and grep got called. Linking these static makes a big difference. As a compromise, how about converting the major space wasters in /bin and /sbin to dynamic but leaving the rest? Except for /bin/sh, none of them are run often enough to matter. -r-xr-xr-x 1 root wheel 475108 Sep 7 17:50 /sbin/routed* -r-xr-xr-x 1 root wheel 495943 Sep 7 17:50 /sbin/fore_dnld* -r-xr-xr-x 1 root wheel 521654 Oct 22 12:14 /sbin/tunefs* -r-xr-xr-x 1 root wheel 528572 Sep 7 17:46 /bin/pax* -r-xr-xr-x 1 root wheel 532428 Sep 7 17:46 /bin/ls* -r-xr-xr-x 1 root wheel 605588 Sep 7 17:50 /sbin/ipfstat* -r-xr-xr-x 1 root wheel 616277 Sep 7 17:50 /sbin/ilmid* -r-xr-xr-x 1 root wheel 670188 Sep 7 17:50 /sbin/fsdb* -r-xr-xr-x 1 root wheel 695512 Sep 7 17:50 /sbin/vinum* -r-xr-xr-x 1 root wheel 713372 Oct 8 00:44 /bin/sh* -r-xr-xr-x 1 root wheel 752168 Sep 7 17:58 /sbin/dhclient* -r-xr-xr-x 2 root wheel 844512 Sep 7 17:46 /bin/tcsh* -r-xr-xr-x 1 root wheel 3214381 Oct 25 10:29 /sbin/ipfw* -r-xr-xr-x 2 root wheel 3420946 Oct 25 16:02 /sbin/rdump* -r-xr-xr-x 3 root wheel 3464372 Oct 22 12:07 /sbin/fsck_ufs* -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message