Re: simple task to speed up booting

From: Ian Lepore <ian_at_freebsd.org>
Date: Sun, 21 Dec 2014 22:05:43 -0700
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?

-- Ian


Received on Mon Dec 22 2014 - 04:05:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:54 UTC