Improving Bootup Times

Discussion in 'Linux' started by ags, Sep 13, 2008.

  1. ags

    ags

    Joined:
    Jul 22, 2008
    Messages:
    34
    Likes Received:
    0
    A few weeks ago I came across a discussion paper at the Ubuntu MID site about improving boot times for Network Remix. I looked again recently but the paper was gone.

    In short the Ubuntu team did a Bootchart and found that most of the boot time was spent doing modprobe operations. Digging a bit deeper they found that most of the problem was the commands 'udevadm trigger' and 'udevadm settle' in the bootup script /etc/init.d/udev. Basically 'udevadm trigger' runs through the udev rules and at Rule 90 it starts modprobing every possible kernel module and their aliases. Then 'udevadm settle' makes the whole boot process wait until this is completed.

    The Ubuntu approach was to do some complicated udev rules that delayed some of this until after the desktop was up and running. However I couldn't find the code for this.

    They also suggested just removing 'udevadm settle' and letting the boot process continue while udeadm continued in the background. That sounded like a good idea to me, so I tried it and boot time was noticeably decreased. A few weeks later there are no ill affects.

    This was what I did:
    Original code in /etc/init.d/udev
    Code:
    	# Fix permissions and missing symlinks/programs for devices made in
    	# initramfs, and catch up on everything we missed
    	log_begin_msg "Loading hardware drivers..."
    	/sbin/udevadm trigger
    	if /sbin/udevadm settle; then
    	    log_end_msg 0
    	else
    	    log_end_msg $?
    	fi
    
    Changed code:
    Code:
    	# Fix permissions and missing symlinks/programs for devices made in
    	# initramfs, and catch up on everything we missed
    	log_begin_msg "Loading hardware drivers..."
    	/sbin/udevadm trigger
    	#if /sbin/udevadm settle; then
    	#    log_end_msg 0
    	#else
    	#    log_end_msg $?
    	#fi
    
     
    ags, Sep 13, 2008
    #1
  2. ags

    hardran3

    Joined:
    Aug 11, 2008
    Messages:
    73
    Likes Received:
    0
    Location:
    Swift Current, SK, Canada
    I will give this a try. How many seconds did it shave off of your boot time?
     
    hardran3, Sep 13, 2008
    #2
  3. ags

    soderkvist

    Joined:
    Aug 19, 2008
    Messages:
    9
    Likes Received:
    0
    Location:
    Sweden
    Hmm looks like a good 2 seconds-ish =)
     
    soderkvist, Sep 17, 2008
    #3
  4. ags

    daymz

    Joined:
    Jul 28, 2008
    Messages:
    44
    Likes Received:
    0
    Location:
    Montreal, QC, Canada
    I'd really like it if many people could share their tweaks in here. To me, the boot up time is the most important thing on the AA1. Ironically, XP is the best for me (running the A110/Samsung SSD model) in terms of features vs. boot time.

    When you say you saved 2 seconds-ish, out of how much total boot time (from netbook power-up to desktop-is-available) ? If other people want to share their tricks, it would be worth it to describe your system fully in order to avoid uncomparable systems. (eg: include: Aspire One model and storage (A110 on Samsung SSD, A150 on 120GB HD, etc.), the release (Ubuntu 8.04.1, OneLinux's Ubuntu, XUbuntu 8.04.1, Ubuntu 8.10 Intrebid Ibex, etc.) and whether you have a fully working system or partially working (eg: Fully working, Partially Wifi LED off using MadWifi X.Y, etc.)
     
    daymz, Sep 18, 2008
    #4
  5. ags

    ags

    Joined:
    Jul 22, 2008
    Messages:
    34
    Likes Received:
    0
    Ha, I think I did much better than 2 seconds. I didn't time the process before and after, so I don't know exact figures.

    I've been posting various tweaks and fixes in these forums for a while. Most of these have been works in progress following the open source maxim; "Release early, release often". The intention was that others will try them and collectively we will improve them.
     
    ags, Sep 19, 2008
    #5
  6. ags

    ags

    Joined:
    Jul 22, 2008
    Messages:
    34
    Likes Received:
    0
    The Atom processor in AA1 supports hyperthreading, so instead of running the boot-up scripts in a serial fashion, the scripts can be run concurrently.

    This has been mentioned somewhere else in the forum, but I can't find the reference now.

    To enable concurrent booting, open up the file /etc/init.d/rc, and change the line:

    Code:
    CONCURRENCY=none
    to

    Code:
    CONCURRENCY=shell
    The second part of the boot process positively whizzes along... :D
     
    ags, Sep 28, 2008
    #6
  7. ags

    basko

    Joined:
    Aug 21, 2008
    Messages:
    8
    Likes Received:
    0
    basko, Oct 9, 2008
    #7
  8. ags

    Demiurge

    Joined:
    Aug 8, 2008
    Messages:
    28
    Likes Received:
    0
    Location:
    Norway
    Before: from grub-menu to login ~42 sec
    After: from grub-menu to login ~40 sec

    A110L w/ 1.5GB ram, fresh installation of Hardy Heron 8.4.01 with CONCURRENCY=shell. So it's not much to gain, merely 1% in my case.
     
    Demiurge, Oct 12, 2008
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.