Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Optimizing boot time on SLOW laptop
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
dspahn
Apprentice
Apprentice


Joined: 22 Jun 2006
Posts: 282

PostPosted: Mon Aug 27, 2007 5:54 pm    Post subject: Optimizing boot time on SLOW laptop Reply with quote

I came into possession of a really small laptop, with all sorts of extra accessories, and I want to use it to build an MP3 player. I have already installed Gentoo as the OS because I have not been able to find the hardware support in other linuxes, and I only have so much patience for the rather arduous install process... the processor is a 700 MHz, intel. It's a Toshiba Portege 3490CT. Current boot time is 5 minutes from the time I choose the installation from grub menu until I get to the login prompt.
rc-update show gives me this:
Code:

alsasound default
bootmisc boot
checkfs boot
checkroot boot
clock boot
consolefont boot
hostname boot
keymaps boot
local default nonetwork
localmount boot
modules boot
rmnologin boot
urandom boot


Starting X (I use Fluxbox) only takes a minute or two. I definitely need the following capabilities:
PCMCIA
Wireless
Networking
USB
ALSA
Power Management

But I don't always need everything- For example, 95% of the time, I don't need Wireless or Networking. I will probably be adding an Audigy 2 PCMCIA card for audio output because the built-in sound distorts above 10% on any headphones/speakers, but for the moment, I don't need PCMCIA unless I am doing wireless networking on it (Used for updating the music library and Portage functions).

I guess the first place to start is... startup.
I am trying to figure out the best kernel options- are there any items I should definitely turn on or turn off? Is this a case where I should use an initrd (I'm not at the moment)?
My applicable grub.conf entry is as follows:
Code:

title=Kernel Z
root (hd0,0)
kernel /boot/kernel-z root=/dev/hda2 quiet


uname -a returns:
Code:

Linux localhost
2.6.22-gentoo-r2 #1 PREEMPT Mon Aug 20 13:12:23 Local time zone must be set--see   i686 Pentium III (Coppermine) GenuineIntel GNU/Linux


cat /proc/cpuinfo returns:
Code:

processor 0
vendor_id GenuineIntel
cpu family 6
model 8
model name  Pentium III (Coppermine)
stepping 6
cpu MHz  700.031
cache size  256 KB
fdiv_bug no
hlt_bug no
f00f_bug no
coma_bug no
fpu yes
fpu_exception yes
cpuid level 2
wp yes
flags fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips 1403.90
clflush size 32


I am using the following for CFLAGS:
-O2 -march=i686 -fomit-frame-pointer -pipe

I have this CHOST:
"i686-pc-linux-gnu"

I needed that CHOST to build the version of GCC that was required for one of the packages on the system.
I appreciate any advice on this. I can't post directly from that computer, so I have to type everything as I see it... let me know if any more info will be helpful.

Thanks!
Back to top
View user's profile Send private message
danomac
l33t
l33t


Joined: 06 Nov 2004
Posts: 817
Location: Vancouver, BC

PostPosted: Mon Aug 27, 2007 6:48 pm    Post subject: Re: Optimizing boot time on SLOW laptop Reply with quote

dspahn wrote:

I am using the following for CFLAGS:
-O2 -march=i686 -fomit-frame-pointer -pipe


For a laptop, I'd recommend -Os which optimizes for size. Have you tried turning on parallel loading for the initscripts?

Also, netplug will background the network interface so it won't sit and wait for a DHCP timeout.

I don't even think my P2 laptop takes that long to load, although I don't believe I have a gui installed on it.
Back to top
View user's profile Send private message
dspahn
Apprentice
Apprentice


Joined: 22 Jun 2006
Posts: 282

PostPosted: Mon Aug 27, 2007 6:54 pm    Post subject: Thank you! Reply with quote

I have parallel initscripts enabled (but I have enabled that since I timed it!)
I will change to -Os and see if I see a difference after I rebuild the OS. I am working through the Gentoo wiki on hdparm to see if that will speed things up. I have ifplugd installed, but most of the time, I boot without a network interface attached, and I don't have any net.* scripts starting automatically.... yet....
Back to top
View user's profile Send private message
danomac
l33t
l33t


Joined: 06 Nov 2004
Posts: 817
Location: Vancouver, BC

PostPosted: Mon Aug 27, 2007 7:24 pm    Post subject: Reply with quote

I'd actually change your CFLAGS to

Code:

-Os -march=pentium3 -fomit-frame-pointer -pipe


and add "mmx sse" to your USE flags (some packages will use enchancements) before you rebuild.

One more thing: are you sure your processor is running at maximum speed? I remember my P2 would default at 133MHz until I told cpufreqd to up it.

You can emerge cpufrequtils and use cpufreq-info to tell you this.
Back to top
View user's profile Send private message
danomac
l33t
l33t


Joined: 06 Nov 2004
Posts: 817
Location: Vancouver, BC

PostPosted: Mon Aug 27, 2007 7:35 pm    Post subject: Reply with quote

I dragged out my old laptop (Pentium2-233/64M RAM) and timed it to the login prompt and it took 64 seconds. (Not booting into a desktop, just to cli.)

I don't have parallel initscripts enabled on this laptop either... o_O

Wow, is this laptop out of date... can't remember the last time I used it. :wink:
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Tue Aug 28, 2007 2:24 am    Post subject: Reply with quote

5 minutes is pretty slow in fact.
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
dspahn
Apprentice
Apprentice


Joined: 22 Jun 2006
Posts: 282

PostPosted: Tue Aug 28, 2007 2:53 am    Post subject: So far... Reply with quote

I have boot time down to about 4 minutes. I'm wondering if there are some kernel options that may increase the latency or that may simply not be necessary.
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Tue Aug 28, 2007 2:54 am    Post subject: Reply with quote

Have you build a custom kernel yet ?
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
dspahn
Apprentice
Apprentice


Joined: 22 Jun 2006
Posts: 282

PostPosted: Tue Aug 28, 2007 3:06 am    Post subject: yes... Reply with quote

I built a few custom kernels on this machine- a couple to test out different network configurations, but there are a number of options that typically I just leave because they work when I leave them and I don't want to break anything, particularly on this computer, as the only way to recover a borked OS is to physically remove the hard drive- it will not boot from floppy, cd, or network. I have previously set up a minimal bootable system on the hard drive, that will work with the hardware, then set everything else up on the computer over the network. Are there any options that would introduce extra latency in the kernel? I have it set up to have almost everything loaded as modules- an attempt to keep a small kernel for the low amount of RAM (128 MB).

What do you think?
Thanks!
Back to top
View user's profile Send private message
d2_racing
Moderator
Moderator


Joined: 25 Apr 2005
Posts: 13046
Location: Ste-Foy,Canada

PostPosted: Tue Aug 28, 2007 3:10 am    Post subject: Reply with quote

I think that building a small kernel is the best for speed.

Maybe your box is just slow... in fact what do you have for hdd...a 4200 rpm or a 5400 rpm maybe ?
_________________
Sysadmin of GentooQuébec.org
Wiki
Signature
IRC on Freenode : #gentoo-quebec
Back to top
View user's profile Send private message
pussi
l33t
l33t


Joined: 08 May 2004
Posts: 727
Location: Finland

PostPosted: Tue Aug 28, 2007 11:12 am    Post subject: Re: yes... Reply with quote

dspahn wrote:
I have it set up to have almost everything loaded as modules- an attempt to keep a small kernel for the low amount of RAM (128 MB).
afaik if you're loading any modules on boot time its much faster to have them built in kernel.

you could also try using faster init system like einit.
Back to top
View user's profile Send private message
danomac
l33t
l33t


Joined: 06 Nov 2004
Posts: 817
Location: Vancouver, BC

PostPosted: Tue Aug 28, 2007 2:56 pm    Post subject: Reply with quote

I am loading zero modules. Well, that's a lie, I think it's loading one module - but 10 seconds or more of the 64 seconds of my boot time is it trying to figure out the dependencies of the modules. Maybe that's what's wrong.

Everything is built directly into the kernel on my P2.
Back to top
View user's profile Send private message
TuxTom
n00b
n00b


Joined: 04 Jan 2007
Posts: 57

PostPosted: Tue Aug 28, 2007 3:00 pm    Post subject: Reply with quote

Have you checked that dma is working with your hd?

I accidently didn't compile the right module for my pci-chipset on my laptop and so dma was off... Compiling the right module let me activate it, it speeded up disk reads by factor 10.

Greetz, TuxTom
Back to top
View user's profile Send private message
AdShea
n00b
n00b


Joined: 10 Mar 2005
Posts: 58

PostPosted: Tue Aug 28, 2007 3:21 pm    Post subject: Reply with quote

I've the same laptop. My boot times are around 2-3minutes, and that's with ivman loading and everything.

A couple things you might want to try.

* The 4200 RPM harddrive that comes with it is hideously slow. Look on e-bay and you should be able to find a 5400RPM drive that's in the 40GB range for cheap (<$30US)
* The internal audio sounds great for me, try using alsamixer and setting all the gains to 0dB and then use the analog volume control on the front. The onboard speaker is a tiny 1" plastic disk that will never sound good, but headphones should be fine.
* cpufreq doesn't work with this P3. It's one of the first line of Speedstep processors, and thus the control interface is borked. You'll need to go into the BIOS and tell it to force 700MHz operation.
* Build your own kernel. Genkernel takes a lot of time, especially with slow harddrives due to using modules for everything. Also, you may be better off having your /usr and / on a separate partition than /home or wherever your data is (putting /usr/portage on its own helps too) this should help keep files localized for better harddrive performance.
* Be sure to check hdparm settings.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum