From owner-freebsd-arch@FreeBSD.ORG Tue Jun 3 06:47:02 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 6739437B401 for ; Tue, 3 Jun 2003 06:47:02 -0700 (PDT) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C0C343FAF for ; Tue, 3 Jun 2003 06:47:01 -0700 (PDT) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.9/8.12.9) with ESMTP id h53DjtOn080452; Tue, 3 Jun 2003 09:45:55 -0400 (EDT) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)h53DjtN1080449; Tue, 3 Jun 2003 09:45:55 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Tue, 3 Jun 2003 09:45:54 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Andrew Gallatin In-Reply-To: <16092.36129.388194.477452@grasshopper.cs.duke.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: Tue, 03 Jun 2003 13:47:02 -0000 On Tue, 3 Jun 2003, Andrew Gallatin wrote: > > > Webservers and all other applications which run shell scripts exec a > > > shell to interpret that script. Regardless of how the parent is > > > linked, if the exec'ed shell is dynamically linked, there is an added > > > cost to exec'ing it. > > > > and these are usually perl, php, or compiled cgi programs, not /bin/sh. > > Ok, maybe a webserver is a bad example. But you must admit that /bin/sh > is commonly used outside the startup scripts. I think this is an area where an investment of time in prebinding may have a substantial payoff. Matt Dodd has been doing some experimentation on a number of different prebinding approaches, and has demonstrated pretty measurable performance improvements for common dynamically linked applications (of which we have a number that would really benefit from it). Presumably prebinding wouldn't 100% recover the cost of a switch to dynamic linking for a static binary, but it could well recover 90%. Hopefully Matt can post some of his initial experimentation results in the next few weeks as they become more mature. Unfortunately, the /bin/sh case really does appear to be the most pessimal case for even optimized dynamic linking: sh has a sufficiently short run time and small enough memory footprint that the reduced memory overhead of using shared memory for its libc access presumably doesn't outweight the startup costs. There are presumably environments where sh is invoked a lot -- perhaps in some CGI environments, during large builds, etc. I'd be very interested in seeing some performance results there. Unfortunately, our benchmarking capacity for things like this is a bit limited while the 5.x kernel still has lower I/O throughput due to fine-grained locking not hitting some of the storage subsystems. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories