Date: Mon, 22 Dec 2014 09:51:21 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-current@freebsd.org Cc: Poul-Henning Kamp <phk@phk.freebsd.dk>, current@freebsd.org, Ian Lepore <ian@freebsd.org> Subject: Re: simple task to speed up booting Message-ID: <201412220951.22027.jhb@freebsd.org> In-Reply-To: <1419224743.1018.108.camel@freebsd.org> References: <43445.1418553160@critter.freebsd.dk> <1419224743.1018.108.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412220951.22027.jhb>