Re: faster boots?

Richard Gooch
2002-04-05T02:18:52Z

Andrew Morton writes:
> Joe, you're speaking to a bunch of people who reboot their
> boxes ten times an hour or more. It's an interesting topic.
>
> If you want to get really radical you could investigate
> Richard Gooch's boot scripts which I believe allow all the
> initscripts to be launched in parallel. Which is a good
> thing to do.
>
> http://www.atnf.csiro.au/people/rgooch/linux/boot-scripts/

Around 20 seconds or less from when the kernel starts init(8) to when
my XDM splash screen is up, last time I checked.

> Last year I developed a bunch of code which was designed to
> speed up the boot process. It works as follows:
>
> 1: Boot the machine, start your X server or whatever you
> normally do. Wait for everything to settle down.
>
> 2: Load a kernel module and run a userspace app which dumps
> out a directory of your pagecache and buffercache contents
> to a database file. It's of the form:
>
> filename:page,page,page,page and
> device:block,block,block,
>
> The database file is sorted in ascending block order.
>
> 3: Next time you reboot, load a different kernel module and
> run a different userspace app which together walk that
> database and preload the pagecache and buffercache.
>
> The theory was lovely. And I tried all sorts of stuff. But
> the bottom line benefit was only about 10%. The whole thing
> was constrained by buffercache seek time - filesytem metadata.

The problem is that you're not listing the metadata blocks when
building the database, right? And that's because Linus didn't want
such hackery in the kernel. So instead we got the not-very-useful
readahead system call.

> Oh well. The best benefit was in fact from launching all
> the initscripts in parallel. Lots of stuff broke because
> of the lack of any sort of dependency system, but it was
> appreciably quicker.

Of course, my boot scripts do the dependency stuff right (actually,
it's the changes I made to simpleinit(8) that make it possible).

> I guess the greatest benefit would come from reorganising the
> layout of the root filesystem's data and metadata so the
> pagecache prepopulation doesn't have to seek all over the place.

Or being able to preload *everything* in ascending order...

Regards,

Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca