From owner-freebsd-current@FreeBSD.ORG Mon Dec 22 15:06:48 2014 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21A44304; Mon, 22 Dec 2014 15:06:48 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF001831; Mon, 22 Dec 2014 15:06:47 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E3AF6B9B1; Mon, 22 Dec 2014 10:06:46 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Subject: Re: simple task to speed up booting Date: Mon, 22 Dec 2014 09:51:21 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <43445.1418553160@critter.freebsd.dk> <1419224743.1018.108.camel@freebsd.org> In-Reply-To: <1419224743.1018.108.camel@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201412220951.22027.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 22 Dec 2014 10:06:47 -0500 (EST) Cc: Poul-Henning Kamp , current@freebsd.org, Ian Lepore X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-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: Mon, 22 Dec 2014 15:06:48 -0000 On Monday, December 22, 2014 12:05:43 am Ian Lepore wrote: > On Sun, 2014-12-14 at 10:32 +0000, Poul-Henning Kamp wrote: > > The rotating swirlie ('-/|\') in the loader accounts for a surprisingly > > large part of our boot time on systems with slow-ish serial consoles. > > > > I think right now it takes a step for each 512 byte read, reducing that > > to once every 64kB or even 1MB would be an improvement with the kind of > > kernel sizes we have today. > > > > I investigated this a bit today. I instrumented the loader on arm to > count how many times twiddle() is called while loading a 5.5MB kernel. > When loading over NFS it was called 5580 times. When loading from an > sdcard it was called 284 times. > > Poking around in the code, it looks like NFS calls twiddle() once per 1K > block read, CD9660 once per 2K block, and UFS and ext2fs once per > filesystem blocksize block. All of them have some other scattered > twiddle calls while navigating metadata that probably don't add up to > much compared to the bulk reading. > > My amd64 kernel is twice as big even with lots of the generic devices > removed; that's a lot of IO. But one twiddle per filesystem block > shouldn't be so bad... let's call it 600 twiddles, each one writes 2 > bytes to serial, so a total of ~1200mS at 9600bps. The same kernel > loaded over nfs would cost over 20 seconds in serial output. > > So all in all it seems like different kinds of IO need different > throttling, something like the attached (which also still has some stats > output in it). I can't decide if it's worth committing... it'll have a > lot of value to someone with slow serial and netbooting, is that common? 9600 consoles are still fairly common, so if this makes a noticable difference for NFS, by all means test it and get it in. -- John Baldwin