Howto using sreadahead to cut down linux start time

letharion
letharion used Ask the Experts™
on
Here: http://lwn.net/Articles/299483/ a laptop is booted in 5 seconds.
Part of that is achieved using "sreadahead": http://code.google.com/p/sreadahead/

I'd like to try the kernel patch, and see if I can improve start time. How?
I've downloaded the archive, made a copy of my current kernel, extracted the patch into that directory, but then I hit the first problem:

I'm not sure exactly how to apply the patch.
I have experimented with a few different ways, but when I'm done, make doesn't work, so I'm probably doing something wrong.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I don't know this sreadahead, but to patch your kernel, just enter to your kernel directory and run command:
patch -p1 < /path/to/0001-superreadahead-patch.patch
Oh, one more - do not extract this tarball to your kernel directory, as you will overwrite your Makefile.

Author

Commented:
Aha, maybe that's why make didn't find a target?
So I just copy the 3 code files and the patch file to the source dir and then patch with -p1?
Must've messed up my no-ip, cause I can't seem to use it. Gonna try it when I get home in about 2 hours. :)
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

As I can see, this sreadahead is standalone deamon. Don't copy it's files to your kernel sources directory.
Apply the patch in a way I wrote in previous comment. Then you should probably recompile your kernel, and after booting with patched kernel, you should try to compile sreadahead (I'm just guessing - maybe there is possibility to compile sreadahead before running patched kernel - just try, but even if it possible, kernel recompilation is needed anyway :)).

Author

Commented:
Oh, hmm. Ofc. The patch is for the kernel, and the rest of the files are a separate program.
That's makes sense now that I think about it. Like I said I'm gonna try it out later.

Author

Commented:
Ok, I could patch the kernel fine, and compile the programs. I made a list for sread on what files to preload, and I think I got that part working, because my latest bootchart show a great deal better disk usage, but also a lot more disc usage, so made I'm loading to much data...

Anyway, I didn't gain a single second (from 27 secs) on my boot time, which feels wierd. Logging in to KDE feels somewhat faster, but I haven't measured the time yet.

I'm attaching a bootchart. It's a bit old, but still more or less accurate. I'm wondering if at least part of my problem is that I don't start a lot of "large" programs, but instead dhcpcd is taking a significant amount of time, which sread can't do much about.
bootchart.png

Author

Commented:
Here's the latest bootchart :)
bootchart.png

Author

Commented:
Thanks a lot for your help :)

Author

Commented:
It's unfortunate that I didn't gain any speedup, but that may be a bug in sreadahead. I've also noticed that work has continued on the deamon, and a 1.00 has been released for a 6.29 kernel.

I'm gonna try it out later :)
I rather use hibernate on my laptop, but it's a little buggy (or my configuration is ;)) and not always it hibernates or restores properly (more often it doesn't want to restore than hibernate). So - sometimes I have to go through whole booting process, and it's looooong :) Maybe I'll try that sreadahead also, but... too bad that it is still 0.04 version in portage, and it's still masked :/

Author

Commented:
0.04 unfortunately doesn't work with 2.6.28
see: http://code.google.com/p/sreadahead/issues/list
but perhaps an 0.05 comes out and we can try it :)
Well, I'm still using 2.6.24 with tuxonice patches. But, as there is already 2.6.28 tuxonice available, maybe I'll upgrade :)
Anyway - thanks for info. I didn't even know sreadahead before your question ;)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial