From owner-freebsd-arch Wed Aug 21 9:19:49 2002 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 482A337B400 for ; Wed, 21 Aug 2002 09:19:46 -0700 (PDT) Received: from iguana.icir.org (iguana.icir.org [192.150.187.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id D7DA343E6A for ; Wed, 21 Aug 2002 09:19:45 -0700 (PDT) (envelope-from rizzo@iguana.icir.org) Received: from iguana.icir.org (localhost [127.0.0.1]) by iguana.icir.org (8.12.3/8.11.3) with ESMTP id g7LGJhIb059428; Wed, 21 Aug 2002 09:19:43 -0700 (PDT) (envelope-from rizzo@iguana.icir.org) Received: (from rizzo@localhost) by iguana.icir.org (8.12.3/8.12.3/Submit) id g7LGJgqc059427; Wed, 21 Aug 2002 09:19:42 -0700 (PDT) (envelope-from rizzo) Date: Wed, 21 Aug 2002 09:19:42 -0700 From: Luigi Rizzo To: "M. Warner Losh" Cc: nbm@mithrandr.moria.org, arch@FreeBSD.ORG Subject: Re: ugliness in rc.* scripts Message-ID: <20020821091942.B59085@iguana.icir.org> References: <20020820232538.A53816@iguana.icir.org> <20020821074819.GA58163@mithrandr.moria.org> <20020821061822.A56560@iguana.icir.org> <20020821.095726.109035410.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020821.095726.109035410.imp@bsdimp.com>; from imp@bsdimp.com on Wed, Aug 21, 2002 at 09:57:26AM -0600 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Aug 21, 2002 at 09:57:26AM -0600, M. Warner Losh wrote: > In message: <20020821061822.A56560@iguana.icir.org> > Luigi Rizzo writes: ... > : i think it is only one process -- echo is a builtin, tolower is a shell > : function. In any case, we never cared about performance in the rc scripts, > : not spawning processes (e.g. calling scripts with . instead of sh) has > : only to do with letting variable assignements be visible in the caller. > > Actually, we have cared about the performance of shell scripts in the > past. NetBSD got a nasty surprise when they went to their new rc ... oh man, should i always include a track record when i make a posting ? sure, we do care about performance everywhere (except perhaps in -current :). I have spent a huge amount of time doing performance improvements in FreeBSD all across the board, and i do care about embedded things, as witnessed by my work on picobsd... my point is that a few occasional process forks during startup because of judiciously called external processes (i certainly don't plan to put these things within a loop) won't hurt too much. I would say that the impact would be much lower than what we currently pay by having statically-linked, non-crunched binaries in /bin and /sbin. Also, following your previous suggestion about a "case -i" : the problem is that then our scripts would then become non-portable. If we have to go to non-standard approach, i would rather implement some commands as shell builtins so that we do not pay the fork overhead in a fully transparent way. E.g. 'tr' could be one, expr another one, rm another one (it is run within a couple of loops in /etc/rc ...) I would also look for some way to implement (cheaply) associative arrays... cheers luigi > boot process. Some machines went from taking 10 seconds to boot to > taking 30 minutes. They fixed this in two ways: 1) by reducing the > number of forks in the rc scripts and 2) by fixing bugs in that > architecture that make fork insanely slow. > > We still need to boot fast enough that things aren't insanely slow on > a 32MB 66MHz 486. There's enough embedded people doing embedded > things that will likely want 5.0 that we have to keep that in mind. > The company I work for has systems with 133MHz 486-class CPUs that we > ship with 32MB RAM. > > Warner > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message