You are not logged in.

#1 2006-02-22 18:02:24

mac57
Member
From: St. Somewhere
Registered: 2006-01-06
Posts: 302
Website

Boot Time, Memory Optimization Very Successful

Based on an earlier thread here, and my frustration at having 149 modules loaded by my Arch Linux 0.7.1 (Noodle) boot sequence, I decided to take the plunge and start optimizing. It was VERY successful, and I thought I would pass the results along, to encourage others to do the same.

Here's what I did:

1) Built a new initrd. It was incredibly easy and very smooth. I backed up the current /boot/initrd26.img, and /etc/mkinitrd.conf. Then I edited initrd.conf and turned off the SATA, SCSI and CD systems (remember, in your initrd, all you need is support for things Arch will *boot* from - if you don't realize this, turning off CD might seem counter intuitive). Then I really went out on a limb and turned ON the AUTODETECT flag. Finally, I set the FILESYSTEMS line to just "ext3 reiserfs". Then, just issue the command "mkinitrd auto --show" and the new initrd builds and places itself into /boot.

Net result: I went from 149 modules loaded to only 68. By restricting the file systems to just ext3 and reiserfs (again, remember that this just applies to boot time - Arch still supports all those other wonderful file systems once booted) I also eliminated about 8 processes that used to launch in support of the XFS and JFS filesystems. Excellent!

2) Next I edited /etc/rc.conf, and eliminated another four modules related to gameport support, which I did not need, by placing them on the module BLACKLIST. Net result, down to 64 modules loaded. Most of them looked pretty necessary, and I stopped there.

3) Finally I edited /etc/rc.conf again, and put an "@" in front of the last two daemons in my DAEMONS list, those being "hplip" and "cups" (support for my HP Deskjet 952c). This causes those daemons to load in the background, instead of "in-line" with the boot process. Net result: 4 seconds saved off a 22 second boot time (Grub prompt to console login prompt). Not a dramatic change, but nice.

So, when it is all said and done, my Arch now loads fewer than half the modules it used to, uses less memory, starts fewer processes, and boots faster than before. Pretty pleasing results for an hour or two of work.

All of this was done on standard Arch 0.7.1 (Noodle), pretty much "right out of the box". I have loaded lots of apps of course, and configured menus and the like, but this is the first material tinkering I have done with *Arch* itself.

So, all you folks who are upset like I was that this lovely streamlined and speedy releases loads SO many modules, take heart, and take steps. It works!
:!:


Cast off the Microsoft shackles Jan 2005

Offline

#2 2007-04-13 16:06:51

Tommy Angelo
Member
From: Slovakia
Registered: 2007-04-10
Posts: 7

Re: Boot Time, Memory Optimization Very Successful

can you describe or write what exactly you change in these files? "/boot/initrd26.img" "/etc/mkinitrd.conf" "rc.conf" and can be this applied on Arch Voodoo?

Offline

#3 2007-04-13 17:09:13

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: Boot Time, Memory Optimization Very Successful

You know that 0.8 (Voodoo) has initramfs, and thus only loads the modules it needs through udev right? I guess you would have figured that out if you had updated your system... neutral hehe


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

#4 2007-04-13 18:06:38

venox
Member
From: Curitiba, Brazil
Registered: 2003-08-23
Posts: 137
Website

Re: Boot Time, Memory Optimization Very Successful

Just disable MOD_AUTOLOAD on rc.conf, make your own MODULES list, mkinitcpio.conf (I never use the autodetect hook) and bam! You've just got full control over your loaded modules.

Last edited by venox (2007-04-13 18:07:30)

Offline

#5 2007-04-14 16:20:17

Tommy Angelo
Member
From: Slovakia
Registered: 2007-04-10
Posts: 7

Re: Boot Time, Memory Optimization Very Successful

super smile and how can I realize which modules are loaded?  (than I try to add these modules to "mkinitcpio.conf")

Offline

#6 2007-04-14 17:52:59

Tommy Angelo
Member
From: Slovakia
Registered: 2007-04-10
Posts: 7

Re: Boot Time, Memory Optimization Very Successful

which modules I need?

lsmod

Module                  Size  Used by
ipv6                  252736  8
nls_cp437               5888  1
vfat                   10624  1
fat                    46108  1 vfat
ntfs                  219540  2
radeon                121248  2
drm                    70804  3 radeon
snd_seq_oss            29184  0
snd_seq_midi_event      6528  1 snd_seq_oss
snd_seq                46672  4 snd_seq_oss,snd_seq_midi_event
snd_pcm_oss            39072  0
snd_mixer_oss          14464  1 snd_pcm_oss
analog                 10144  0
ppdev                   7556  0
lp                      9604  0
ns558                   4224  0
usbhid                 34592  0
rtc                    10416  0
snd_via82xx            23320  2
gameport               11784  4 analog,ns558,snd_via82xx
snd_ac97_codec         91940  1 snd_via82xx
ac97_bus                2432  1 snd_ac97_codec
snd_pcm                68484  4 snd_pcm_oss,snd_via82xx,snd_ac97_codec
snd_timer              18820  2 snd_seq,snd_pcm
snd_page_alloc          7816  2 snd_via82xx,snd_pcm
snd_mpu401              6376  0
snd_mpu401_uart         7040  2 snd_via82xx,snd_mpu401
snd_rawmidi            19104  1 snd_mpu401_uart
snd_seq_device          6796  3 snd_seq_oss,snd_seq,snd_rawmidi
snd                    43492  15 snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_via82xx,snd_ac97_codec,snd_pcm,snd_timer,snd_mpu401,snd_mpu401_uart,snd_rawmidi,snd_seq_device
soundcore               6496  1 snd
hid                    25088  1 usbhid
parport_pc             35940  1
parport                31176  3 ppdev,lp,parport_pc
ppp_generic            23444  0
slhc                    6272  1 ppp_generic
ff_memless              5256  1 usbhid
pcspkr                  2816  0
i2c_viapro              7956  0
i2c_core               17792  1 i2c_viapro
via_ircc               19604  0
irda                  113464  1 via_ircc
crc_ccitt               2304  1 irda
via_agp                 8448  1
agpgart                26200  2 drm,via_agp
sg                     26652  0
shpchp                 29588  0
pci_hotplug            27976  1 shpchp
tsdev                   6336  0
evdev                   8192  4
via_rhine              20360  0
mii                     4992  1 via_rhine
sr_mod                 14372  0
cdrom                  34464  1 sr_mod
sd_mod                 16768  8
ehci_hcd               29964  0
uhci_hcd               21520  0
usbcore               112392  4 usbhid,ehci_hcd,uhci_hcd
ata_generic             5380  0
pata_via                8580  6
libata                 94100  2 ata_generic,pata_via
ext3                  119688  1
jbd                    55336  1 ext3
mbcache                 7044  1 ext3
reiserfs              234624  1

Offline

#7 2007-04-14 18:15:26

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Boot Time, Memory Optimization Very Successful

That's a pretty unanswerable question... That's really hardware and purpose dependent.
I guess you'll need to look into what each module does and try rmmod'ing it if you think it isn't needed.

Offline

#8 2007-04-14 21:24:55

pelle.k
Member
From: Åre, Sweden (EU)
Registered: 2006-04-30
Posts: 667

Re: Boot Time, Memory Optimization Very Successful

You shouldn't add these modules to mkinitpcio.conf. You should disable module autoload in rc.conf and then put the modules you need in MODULES= array.
Use hwdetect. I quote from "hwdetect --help";

For /etc/rc.conf use:
    --net                  show network MODULES
    --modules              show all detected MODULES

Also, you do have arch linux 0.8 now, right?


"Your beliefs can be like fences that surround you.
You must first see them or you will not even realize that you are not free, simply because you will not see beyond the fences.
They will represent the boundaries of your experience."

SETH / Jane Roberts

Offline

Board footer

Powered by FluxBB