From owner-freebsd-arch@FreeBSD.ORG Mon Jun 2 14:25:45 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A20637B401 for ; Mon, 2 Jun 2003 14:25:45 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9F9943FA3 for ; Mon, 2 Jun 2003 14:25:44 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.9/8.12.6) with ESMTP id h52LPiVI002292; Mon, 2 Jun 2003 14:25:44 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9/8.12.6/Submit) id h52LPhhc002291; Mon, 2 Jun 2003 14:25:43 -0700 (PDT) Date: Mon, 2 Jun 2003 14:25:43 -0700 (PDT) From: Matthew Dillon Message-Id: <200306022125.h52LPhhc002291@apollo.backplane.com> To: Dag-Erling Smorgrav References: <20030602171942.GA87863@roark.gnf.org> cc: arch@freebsd.org Subject: Re: Making a dynamically-linked root X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2003 21:25:45 -0000 : :Gordon Tetlow writes: :> On Mon, Jun 02, 2003 at 10:21:16PM +0200, Dag-Erling Smorgrav wrote: :> > Was /bin/sh dynamically linked? It shouldn't be. :> Why shouldn't it be dynamically linked? I'd like to be able to use :> ~username expansion via nss_ldap. : :Because forking a dynamically linked binary is slower, and /bin/sh :forks a lot. : :DES :-- :Dag-Erling Smorgrav - des@ofug.org I think you meant 'EXECing' a dynamically linked binary is slower. fork() should not be appreciably slower. An exec will take a lot of copy-on-write faults vs static, fork() might take one or two extra faults due to data being strewn all over the place vs static. In anycase, this is a convenience vs performance issue. I think a number of solutions should be investigated before people give up and start hacking dynamic vs static binaries. For example, a lot of startup delay is due to disk waiting (since nothing is in the disk cache at system start!). Running certain daemon startups in the background might yield a significant overall improvement in startup times. e.g. instead of running 'sshd' you would run sshd in a subshell, aka (sshd &), so the RC script can continue on with the next thing without having to wait for sshd to fault-in from disk. Same goes for sendmail and many other daemons. -Matt