View previous topic :: View next topic |
Author |
Message |
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Wed Nov 25, 2009 4:31 pm Post subject: |
|
|
Update
I tested one of my virtual machines, an LDAP/Kerberos server with no graphical interface at all, only Quingy. Boot time is 7.53 seconds according to /proc/uptime. It uses ReiserFS and I'm planning to switch to XFS soon.
I agree, this is no real-life test but I'm fairly pleased with such a low boot time. Features:- Host CPU: Intel Core2 Duo T9400 @ 2.53GHz (ok, not quite everyones machine )
- Host kernel: 2.6.31-gentoo-r4
- Virtual disk: QCOW2, 6GB, 50% free
- Guest kernel: 2.6.27-gentoo-r8, unmodified
- Guest SMP: 2
- Guest system: Baselayout-2 and OpenRC-0.5.2-r2
- Virtio devices for block and network in KVM guest
- Text mode only
- Parallel startup (rc.conf)
- Gentoo stable branch only (except Baselayout, SysVinit and OpenRC)
- Custom network script library (not using OpenRC network scripts at all)
- Static IP address, no DHCP
I didn't use a recent kernel as I didn't want to recompile the whole toolchain (gcc-4.3 and glibc) hence I'm still with glibc-2.8* and gcc 4.1*. I might upgrade gcc (my KVM guest RAM is only 256MB and I need to give it more for GCC to compile... ), glibc and the kernel as well very soon.
Stay tuned for more tests.
EDIT: Now it's worth explaining the extremely low boot time is a warm boot time. Cold boot (on battery) averages 20 seconds. The difference is due to caching on the host side .
EDIT: With XFS on the root filesystem instead of Reiserfs boot time decreases to less than 6 seconds!... (Warm boot again.) _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
Etal Veteran
Joined: 15 Jul 2005 Posts: 1932
|
Posted: Sun Dec 06, 2009 8:21 pm Post subject: |
|
|
disi wrote: | (the longest time takes dhcpcd, should be backgrounding but holds the boot process in the middle ) |
You should pass it the -b flag. |
|
Back to top |
|
|
regomodo Guru
Joined: 25 Mar 2008 Posts: 445
|
Posted: Sun Dec 06, 2009 9:50 pm Post subject: |
|
|
Try linux-2.6.32. I've noticed my boot time to drop noticeably on my laptop. |
|
Back to top |
|
|
Letharion Veteran
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Mon Dec 07, 2009 8:21 am Post subject: |
|
|
AM088 wrote: | disi wrote: | (the longest time takes dhcpcd, should be backgrounding but holds the boot process in the middle ) |
You should pass it the -b flag. |
This was the reason I went to openrc and dhcpcd 5. It backgrounds very fast.
Edit: Spelling |
|
Back to top |
|
|
Xytovl Tux's lil' helper
Joined: 15 Mar 2009 Posts: 92
|
|
Back to top |
|
|
Xytovl Tux's lil' helper
Joined: 15 Mar 2009 Posts: 92
|
Posted: Fri Dec 18, 2009 4:42 pm Post subject: |
|
|
I've just tested them, on an eeePC 901, except for 0003-drm-remove-root-requirement-from-DRM_IOCTL_SET_VERSI.patch that seems to be already applied on gentoo-sources-2.6.32 (or maybe something else I have used before ).
This works great ! bootchart says 13s to gdm (init starts 1.5 seconds earlier)
The other things I had to do to cut times a lot is to blacklist eeepc-laptop and rt2860pci modules, and add a modprobe & command in a newly created script. Is there a clean way to say that some mobules can be loaded in the background ? It takes about 2 seconds to load the modules but they are not needed for the boot process.
The last optimisation is very eee-specific, I have cut readahead-list into two parts : the first one is for the 4Gb SSD (the root filesystem) and is run at sysinit, the second one is for the second SSD and is run after localmount. |
|
Back to top |
|
|
shgadwa Guru
Joined: 12 Mar 2009 Posts: 327
|
Posted: Wed Jan 06, 2010 2:50 pm Post subject: |
|
|
There's some things I've done thats reallly helped.
1. I upgraded to baselayout2 and openrc. It went really smooth and this has helped a lot.
2. I do parallel startups. Some say this is not good, but I've never seen a problem with it.
3. I use wicd so my network cards do not even have to start at boot.
4. I use slim as a lightweight login manager.
5. I upgraded to a 2.6.32 kernel. I used the zen-sources. I started "from seed" using the pappy's guide and I left everything that I did not need unchecked.
6. I added quiet fastboot to the kernel boot line in menu.lst
With the above optimizations, I'm at 23 secs. I would be nice if I could get it smaller than that. Maybe preload might help with starting X. Right now, preload does not even start. Don't know why. Sometimes it works and sometimes it don't.
I've tried to boot with or without a login manager and I get the same speed either way. For now, at least I got a decent improvement.
One thing I've tried that helps is to put xdm on the boot runlevel instead of the default runlevel. This only works sometimes though because often times it would cause X to freeze as soon as it loads to the login window.
Xytovl, do you have any idea how I could add these patches to the 2.6.32-zen3 kernel? |
|
Back to top |
|
|
Xytovl Tux's lil' helper
Joined: 15 Mar 2009 Posts: 92
|
Posted: Thu Jan 07, 2010 8:48 am Post subject: |
|
|
I have never used non gentoo-sources kernels, I imagine it works the same way and creates a directory in /usr/src. You just have to do int the kernel's directory
Code: | patch -p1 < path_to_patch |
you can add --dry-run first if you want to check if it would apply.
Then you compile the kernel normally and copy it to your /boot, update your boot loader and enjoy
My last attempt to gain some time is simply to set NEEDS_HALD to "no" in /etc/conf.d/xdm, with my main devices set in xorg.conf, but have autoadddevices on. X starts before hald, but hotplugging works
For those who want to see a botchart, here it is : http://hfr-rehost.net/fullsize/http://self/pic/59dd2106dd2df0c91afb6401a471358d0687af3c.png |
|
Back to top |
|
|
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Fri Jan 08, 2010 8:43 am Post subject: |
|
|
belikeyeshua wrote: | 4. I use slim as a lightweight login manager. |
As far as I know Slim has been reported broken and unmaintained. Whether true or not, I've switched to gdm (2.20) and it's a little faster than slim ... _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
shgadwa Guru
Joined: 12 Mar 2009 Posts: 327
|
Posted: Tue Jan 12, 2010 2:38 am Post subject: |
|
|
VinzC wrote: | belikeyeshua wrote: | 4. I use slim as a lightweight login manager. |
As far as I know Slim has been reported broken and unmaintained. Whether true or not, I've switched to gdm (2.20) and it's a little faster than slim ... |
Interesting... I did not know that. I've installed gdm. I just need to install a better theme. I think I like it better anyway. Slim is just too simple.
Anyhow, I've been thinking about making gentoo boot faster... and also just making gentoo faster in general. I'm going to be buying some more memory as soon as I can afford it.
There's a couple things that I would like to try. One is readahead as found here: http://www.gentoo-wiki.info/HOWTO_prefetch_files_on_boot. I'm wondering... is this fairly safe? That wiki was made in 2005 and as you all know... Linux changes fast. I've tried to search for sites about readahead that were posted within the last year, and I've not found much.
The other thing I'm doing now is rebuilding my entire system with these LDFLAGS
Code: | LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed" |
We will see if that helps or not... but I hope it will. I think that my computer will probably not be done compiling until tomorrow afternoon and there's about 1000 packages that need to be re-emerged! |
|
Back to top |
|
|
shgadwa Guru
Joined: 12 Mar 2009 Posts: 327
|
Posted: Tue Jan 12, 2010 4:47 pm Post subject: |
|
|
Xytovl,
The link you gave for the kernel patch does not work. It looks like they must of moved it or deleted it. What is the patch called? Maybe I can find it elsewhere online. |
|
Back to top |
|
|
shgadwa Guru
Joined: 12 Mar 2009 Posts: 327
|
Posted: Tue Jan 12, 2010 4:55 pm Post subject: |
|
|
I found this thread here and thought I would dig it out...
How is sreadahead working for you? I've got readahead installed right now. I've not tried it yet because I'm waiting for my system to finish compiling everything with the --as-needed LDFLAG.
Anyhow, there's also Upstart... but I have no idea if it will work on gentoo or not. Right now I boot up in 23 secs. It would be nice to shorten that. We will see what happens after my computer is finished compiling. |
|
Back to top |
|
|
Letharion Veteran
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Tue Jan 12, 2010 5:00 pm Post subject: |
|
|
As I recall I never noticed any difference, and by the time 29 was released and stable, I had forgotten about this.
I'm gonna give it a new go
Let me know what happens. |
|
Back to top |
|
|
Xytovl Tux's lil' helper
Joined: 15 Mar 2009 Posts: 92
|
Posted: Tue Jan 12, 2010 5:35 pm Post subject: |
|
|
You're right, the patchs are not there anymore, the names are :
Code: | 0001-moblin-add-a-EDID-cache.patch
*0002-moblin-fix-vblank-delay-on-pipe-disable.patch
*0003-drm-remove-root-requirement-from-DRM_IOCTL_SET_VERSI.patch
0004-Don-t-blank-display.patch
0005-Ordering-kms-after-sata-in-drivers-Makefile.patch
0006-fastboot-remove-wait-for-all-devices-before-mounting.patch
0007-moblin-make-device-init-asyncronous.patch |
2 and 3 do not apply so I removed them |
|
Back to top |
|
|
shgadwa Guru
Joined: 12 Mar 2009 Posts: 327
|
Posted: Tue Jan 12, 2010 6:26 pm Post subject: |
|
|
Xytovl wrote: | You're right, the patchs are not there anymore, the names are :
Code: | 0001-moblin-add-a-EDID-cache.patch
*0002-moblin-fix-vblank-delay-on-pipe-disable.patch
*0003-drm-remove-root-requirement-from-DRM_IOCTL_SET_VERSI.patch
0004-Don-t-blank-display.patch
0005-Ordering-kms-after-sata-in-drivers-Makefile.patch
0006-fastboot-remove-wait-for-all-devices-before-mounting.patch
0007-moblin-make-device-init-asyncronous.patch |
2 and 3 do not apply so I removed them |
What kernel do you have? I kind of thought that the fastboot option was already in the kernel. How can I find out if I already have the patch or not? I know Zen-Sources is a kernel that comes just about "pre patched" or something like that. |
|
Back to top |
|
|
shgadwa Guru
Joined: 12 Mar 2009 Posts: 327
|
Posted: Tue Jan 12, 2010 7:16 pm Post subject: |
|
|
Great!
While you're at it, here's some things you can try:
1. Rebuild your system with the --as-needed LDFLAG. This is supposed to help a lot. It takes a while though. I'm still not finished rebuilding my system. I think it might be done by tomorrow morning.
2. Upgrade to Baselayout2 & OpenRC. It seems to me like the process is a lot easier now than it was a year ago. OpenRC is more stable too.
3. Experiment with using parallel startup and not using parallel startup. See what is better. I've not tried that yet either as I'm waiting for my system to be done compiling.
4. Type in rc-status and remove all that you no longer need.
5. Put xdm on the boot runlevel instead of the default runlevel. If this will work for you, it usually makes it faster. However, I've not been able to get it working because every time slim loads, it locks up. I'm guessing that maybe this is a slim problem and I just switched to gdm. Maybe that will help.
6. Use the fastboot kernel parameter. This does not make you bootup in 5 seconds, but it shaves a lot off the boot time.
7. Try patching the kernel. Here are some names of some patches:
Code: | 0001-moblin-add-a-EDID-cache.patch
0004-Don-t-blank-display.patch
0005-Ordering-kms-after-sata-in-drivers-Makefile.patch
0006-fastboot-remove-wait-for-all-devices-before-mounting.patch
0007-moblin-make-device-init-asyncronous.patch |
The patches are not that old however the site that had them posted online, no longer has them online so I do not know where you can get them. If you find out, let me know!
Thanks,
~Shawn |
|
Back to top |
|
|
Shining Arcanine Veteran
Joined: 24 Sep 2009 Posts: 1110
|
Posted: Tue Jan 12, 2010 7:22 pm Post subject: |
|
|
I read through this thread and it seems that no one mentioned setting RC_PARALLEL_STARTUP to yes in /etc/conf.d/rc. That should probably yield a decent speed improvement. |
|
Back to top |
|
|
regomodo Guru
Joined: 25 Mar 2008 Posts: 445
|
Posted: Tue Jan 12, 2010 9:39 pm Post subject: |
|
|
Shining Arcanine wrote: | I read through this thread and it seems that no one mentioned setting RC_PARALLEL_STARTUP to yes in /etc/conf.d/rc. That should probably yield a decent speed improvement. |
That's taken as granted. |
|
Back to top |
|
|
pianosaurus l33t
Joined: 19 Apr 2004 Posts: 944 Location: Bash$
|
Posted: Tue Jan 12, 2010 11:06 pm Post subject: |
|
|
belikeyeshua wrote: | 5. Put xdm on the boot runlevel instead of the default runlevel. If this will work for you, it usually makes it faster. However, I've not been able to get it working because every time slim loads, it locks up. I'm guessing that maybe this is a slim problem and I just switched to gdm. Maybe that will help. |
Correct me if I'm wrong, but doesn't those login managers run in an instance of X? If so, you will need a static X configuration in xorg.conf, and not rely on hal, since people start dbus and hal in the default runlevel.
Edit:
Shining Arcanine wrote: | I read through this thread and it seems that no one mentioned setting RC_PARALLEL_STARTUP to yes in /etc/conf.d/rc. That should probably yield a decent speed improvement. |
Right you are. It has been indirectly mentioned many times though, latest in the post above yours. _________________ PKA Cuber
Please add [SOLVED] to the subject of your original post when you feel that your problem is resolved.
Adopt an unanswered post |
|
Back to top |
|
|
Xytovl Tux's lil' helper
Joined: 15 Mar 2009 Posts: 92
|
Posted: Wed Jan 13, 2010 9:09 am Post subject: |
|
|
belikeyeshua wrote: | Xytovl wrote: | You're right, the patchs are not there anymore, the names are :
Code: | 0001-moblin-add-a-EDID-cache.patch
*0002-moblin-fix-vblank-delay-on-pipe-disable.patch
*0003-drm-remove-root-requirement-from-DRM_IOCTL_SET_VERSI.patch
0004-Don-t-blank-display.patch
0005-Ordering-kms-after-sata-in-drivers-Makefile.patch
0006-fastboot-remove-wait-for-all-devices-before-mounting.patch
0007-moblin-make-device-init-asyncronous.patch |
2 and 3 do not apply so I removed them |
What kernel do you have? I kind of thought that the fastboot option was already in the kernel. How can I find out if I already have the patch or not? I know Zen-Sources is a kernel that comes just about "pre patched" or something like that. |
I use gentoo-sources-2.6.32-r1 (the latest ~x86 at the time of writing). 0002 says that the patch seems to be already applied and 0003 prevents the kernel from compiling.
If you know a good service to share the files I can upload them, for now there is a tarball here : http://dl.free.fr/j797CoL2h
I have no idea if there is a fastboot option, there used to be external patches but now even without the parameter it boots extremely fast :
Code: | [ 1.501780] udev: starting version 149 |
edit : the download link is deleted 30 days after the last download, but it does not require any registration or similar |
|
Back to top |
|
|
shgadwa Guru
Joined: 12 Mar 2009 Posts: 327
|
Posted: Wed Jan 13, 2010 12:44 pm Post subject: |
|
|
Well, The fastboot option is that one where you load the kernel with the "fastboot" option... making kernel loading very fast.
However, I'm starting to question this. I think that if I want my computer to bootup faster, I should probably seek out some other means. I mean, this disables fs check... isn't that potentially dangerous? |
|
Back to top |
|
|
Xytovl Tux's lil' helper
Joined: 15 Mar 2009 Posts: 92
|
Posted: Wed Jan 13, 2010 1:33 pm Post subject: |
|
|
I don't think there is a fastboot option, when I grep the source I have
Code: | xytovl@MiniXytovlPC /usr/src/linux $ grep -Ri fastboot *
arch/parisc/kernel/process.c:#ifdef FASTBOOT_SELFTEST_SUPPORT
drivers/net/tg3.c: tw32(GRC_FASTBOOT_PC, 0);
drivers/net/tg3.h:#define GRC_FASTBOOT_PC 0x00006894 /* 5752, 5755, 5787 */ |
I don't think it could hurt if you add this parameter, but the kernel won't do anything with it, and I don't think init will read it.
fschk will run only after a certain amount of mounts, or after a bad halt (power failure or similar). Removing it won't help, there is now an option to do it on shutdown instead of boot, it comes with openRC/baselayout-2 and won't change behaviour in case of power failure. |
|
Back to top |
|
|
shgadwa Guru
Joined: 12 Mar 2009 Posts: 327
|
Posted: Sat Jan 16, 2010 2:47 pm Post subject: |
|
|
So, if I got this right...
Patching the kernel only helps in the seconds before init takes over, right? So its only going to speed up loading the kernel...right? Also, I found out that using the fastboot option does not cause gentoo to not check the hard drive... I don't know where I read that it did.
There is one thing I found that helps a lot... that is, to put xdm on the boot runlevel. This never worked for me in the past. It would lock up 80% of the time. And then I found out that xdm cannot run without hald and dbus. So, I moved them over to the boot runlevel... and now it works. Of course, it doesn't make the computer bootup faster but it load the login window earlier which means you can type in your password while its still booting up.
It would be really nice if we could speed up the loading from the login window to xfce. It seems to take 10-15 secs and it would be really nice if that could be shortened.
Another problem I have is that there are some things that I need to load at boot... such as /opt/lampp/lampp and such. The problem is that it takes about 5 seconds for lampp to startup. I could set it as a application that automatically starts after the computer boots up... but that did not work for me because I need to be root to do that. But, maybe I can just change folder ownerships?
Then there's a lot of other things that I recently am finding a need for... such as openSSH and samba, and such. I've added these to the default runlevel and now my computer boots up in 29-33 secs instead of 23. It would be nice if I could make it load faster. |
|
Back to top |
|
|
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Sat Jan 16, 2010 6:18 pm Post subject: |
|
|
belikeyeshua wrote: | Another problem I have is that there are some things that I need to load at boot... such as /opt/lampp/lampp and such. The problem is that it takes about 5 seconds for lampp to startup. I could set it as a application that automatically starts after the computer boots up... but that did not work for me because I need to be root to do that. But, maybe I can just change folder ownerships? |
There are indeed some services that may start after the login process. What if you delay-start lampp from local.start? _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
shgadwa Guru
Joined: 12 Mar 2009 Posts: 327
|
Posted: Sat Jan 16, 2010 6:59 pm Post subject: |
|
|
VinzC wrote: | belikeyeshua wrote: | Another problem I have is that there are some things that I need to load at boot... such as /opt/lampp/lampp and such. The problem is that it takes about 5 seconds for lampp to startup. I could set it as a application that automatically starts after the computer boots up... but that did not work for me because I need to be root to do that. But, maybe I can just change folder ownerships? |
There are indeed some services that may start after the login process. What if you delay-start lampp from local.start? |
What kind of services? Also, how can I delay-start lampp? |
|
Back to top |
|
|
|