From owner-freebsd-current@FreeBSD.ORG Tue Nov 18 20:03:29 2003 Return-Path: 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 0D88C16A4CE; Tue, 18 Nov 2003 20:03:29 -0800 (PST) Received: from VARK.homeunix.com (adsl-68-123-40-77.dsl.pltn13.pacbell.net [68.123.40.77]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADE1443FCB; Tue, 18 Nov 2003 20:03:27 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.9/8.12.9) with ESMTP id hAJ41Zen063417; Tue, 18 Nov 2003 20:01:35 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.9/8.12.9/Submit) id hAJ41Z44063416; Tue, 18 Nov 2003 20:01:35 -0800 (PST) (envelope-from das@FreeBSD.ORG) Date: Tue, 18 Nov 2003 20:01:35 -0800 From: David Schultz To: Robert Watson Message-ID: <20031119040135.GA63031@VARK.homeunix.com> Mail-Followup-To: Robert Watson , dyson@iquest.net, current@FreeBSD.ORG, "M. Warner Losh" References: <200311182307.hAIN7Wpm000717@dyson.jdyson.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: dyson@iquest.net cc: current@FreeBSD.ORG cc: "M. Warner Losh" Subject: Re: Unfortunate dynamic linking for everything X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2003 04:03:29 -0000 On Tue, Nov 18, 2003, Robert Watson wrote: > (2) Shells again, because they will be fork()d and exec()d frequently > during heavily scripted activities, such as system boot, periodic > events, large make jobs, etc. And presumably the only shell of > interest is sh, although some of the supporting non-builtin binaries > may also be of interest. This is the only performance argument that truly seems compelling, particularly since fork()/exec() performance for dynamic binaries in FreeBSD really sucks as compared to Solaris and AIX (and presumably other systems that have gone dynamic long ago). I think this is mostly an aspect of the dynamic linker and the lack of prebinding rather than performance problems in the VM system. Most of the other arguments both for and against seem less important. The disk space argument that people have been giving is particularly bogus given that disk capacity is increasing 60% per year and the size of /bin isn't. The NSS argument is only valid because NSS was implemented specifically to require dlopen() rather than a daemon, so that disadvantage is in no way fundamental. The best reason in my mind for going dynamic hasn't even been mentioned much. In a fully dynamic system, it is possible to change kernel ABIs without breaking anything as long as the kernel and libc are in sync. Thus, we wouldn't have three versions of statfs() and two versions of accept(), along with other cruft in the kernel to support binaries going back to 4.2BSD. The compatX.Y libraries would suffice. Also, developers would have greater flexibility to extend or otherwise improve system interfaces between minor releases. Unfortunately, this would mean giving up on ABI compatibility for static binaries entirely, so I doubt it would fly anytime soon. Moreover, the performance issues we have with dynamic binaries now really are significant, at least as of a few months ago. (Maybe mdodd's prebinding work addresses some of that.) Dragonfly has addressed the same issue in a different, perhaps more elegant way, wherein even static binaries have forward and reverse ABI compatibility. But it does still require the kernel to mock up legacy fields in shared structures forever, and it doesn't permit me to, for instance, take advantage of the fact that mmap(), msync(), mprotect(), minherit(), madvise(), and mincore() have essentially the same access checks and rewrite them to use a common monitor.