From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 19 11:55:01 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10584106566B for ; Tue, 19 Jun 2012 11:55:01 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 877EE8FC0C for ; Tue, 19 Jun 2012 11:55:00 +0000 (UTC) Received: by eeke49 with SMTP id e49so2209473eek.13 for ; Tue, 19 Jun 2012 04:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=d7Z7ZXf/zpeq7j+rZNKCm5P5v8A7BQCBjokZ6h52uBE=; b=SMj+74n+wZIJ6fPo2f8Ml0O3sAt+LFeWiIcjiMWgbWHD6E5ol2/sLwKAKrqg9ZTp35 lX8rqQ9EAxsCmNVjY6uNwtQ2m33tYTqnjACe6QWD3LVDLoP3gFkbPWZqwphUxNUvSHnd ZaQcykD2r7x6x1yEz0JDmZT7jQ//1/jZ9KA8IMcWmeN+6PBXpaEkx+v+uEn6MTIvMNG3 I5p5wEIEQfO5FQnJklJLprpLn+6Y+q7eofM3G4lWe6OCOSjsyDk/lrVc+MyQBqDBTHzH dRcsEPInDV9rwER9OE92jzdY8xlIv+AgauuKg2LuMWerUdAYotOYCBhvc4z/JTrtAO3i 1nqQ== Received: by 10.14.100.144 with SMTP id z16mr4223282eef.50.1340106899428; Tue, 19 Jun 2012 04:54:59 -0700 (PDT) Received: from gumby.homeunix.com (87-194-105-247.bethere.co.uk. [87.194.105.247]) by mx.google.com with ESMTPS id c42sm75009175eeb.2.2012.06.19.04.54.57 (version=SSLv3 cipher=OTHER); Tue, 19 Jun 2012 04:54:58 -0700 (PDT) Date: Tue, 19 Jun 2012 12:54:55 +0100 From: RW To: freebsd-hackers@freebsd.org Message-ID: <20120619125455.7f19d484@gumby.homeunix.com> In-Reply-To: <4FE0086F.4000507@gentoo.org> References: <20120615124849.GI96212@ass.kameli.org> <20120618081140.GK96212@ass.kameli.org> <4FDF6177.5050608@unsane.co.uk> <4FDF6586.9060501@gentoo.org> <4FDFB166.2040709@FreeBSD.org> <4FE0086F.4000507@gentoo.org> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd8.3) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: Replacing rc(8) (Was: FreeBSD Boot Times) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2012 11:55:01 -0000 On Tue, 19 Jun 2012 01:04:47 -0400 Richard Yao wrote: > On 06/19/2012 12:39 AM, Wojciech Puchar wrote: > > - delay at rc.d scripts - there are some delays inserted. > > > >> The latter item is the only place where making changes to rc.d is > >> going to help, and only then by parellelizing, and even then you > >> are not really going to gain much since most things at boot time > >> are serial. > > > > grep sleep /etc/rc.d/* usr/local/etc/rc.d/* > > > >> > >> So while talk of how to get your favorite boot-time manager into > >> FreeBSD may be entertaining, it's not likely to be productive, and > >> almost > > > > it is unimportant as FreeBSD don't crash. > > OpenRC init scripts lack such delays. They store dependency > information, which enables OpenRC to start them as soon as their > dependencies are ready. That's not the reason for the sleeps. FreeBSD sorts the scripts into dependency order and runs them sequentially, so there's no reason to sleep waiting for a dependency script to complete. The sleeps exist for a variety of reasons. Just looking at the grep can be a bit misleading. Not all of the scripts are going to be used, the sleep is not always relevant to startup, in some case it's in a code path that's not typically taken. One thing that I think could be easily improved is that the polling delays could be changed from 1 second to 0.1 seconds. If there's a reason for rc scipts needing to be portable, there could be a polling delay function with a "fast polling" option in defaults/rc.conf.