You are not logged in.

#1 2009-03-02 12:17:01

PrimoTurbo
Member
Registered: 2008-06-26
Posts: 109
Website

Kernel optimization

Has anyone come across a website that gets into detail about all the options in the kernel .config and which yield the best performance?

I've recompiled my own kernel and changed some settings, but there are too many and most are not documented in much detail in gconfig. My boot time became 5 seconds faster, I'm looking to optimize the kernel even more.

Offline

#2 2009-03-02 12:19:49

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,563

Re: Kernel optimization

I agree that there's not enough documentation. Sites like LWN, the kernel mailing list, and KernelNewbies help somewhat, but not enough.
The kernel help seems more oriented to kernel hackers themselves than power users (both the ? button and the Documentation folder).

Let's discuss kernel configs in here!

Last edited by Ranguvar (2009-03-02 12:20:26)

Offline

#3 2009-03-02 13:02:47

Runiq
Member
From: Germany
Registered: 2008-10-29
Posts: 1,053

Re: Kernel optimization

That'd be great. I tried the same before and referred to google every once in a while. I'll try to put together some resources.

Offline

#4 2009-03-02 14:10:28

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: Kernel optimization

Well, there's the usual, disable everything you don't and won't use (ppp, slip, other network cards, raid, lvm, etc), then perhaps compile it with essential modules in the kernel (filesystem, sd/hd controllers etc).

Can one live without an initrd on Arch?

Offline

#5 2009-03-02 14:33:47

deltaecho
Member
From: Georgia (USA)
Registered: 2008-08-06
Posts: 193

Re: Kernel optimization

If you compile the options you don't need as modules, will they really make much of a difference, performance-wise, if you don't load them?


Dylon

Offline

#6 2009-03-02 14:34:41

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: Kernel optimization

deltaecho wrote:

If you compile the options you don't need as modules, will they really make much of a difference, performance-wise, if you don't load them?

No they won't, you'll just save (little) space

Offline

#7 2009-03-02 15:11:32

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Kernel optimization

Fackamato wrote:

Can one live without an initrd on Arch?

Of course. Arch, and many other distros, use initramfs (not initrd, btw) for boot-time support when using the stock kernel. If you build your own, you can build your boot-time requirements into the kernel i.e. not as modules.

There are exceptions e.g. encrypted root needs an init image.

Offline

#8 2009-03-02 15:17:41

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: Kernel optimization

tomk wrote:
Fackamato wrote:

Can one live without an initrd on Arch?

Of course. Arch, and many other distros, use initramfs (not initrd, btw) for boot-time support when using the stock kernel. If you build your own, you can build your boot-time requirements into the kernel i.e. not as modules.

There are exceptions e.g. encrypted root needs an init image.

initramfs, of course smile, initrd is etched into my memory since early Debian days...

The initramfs only contains the stuff in /etc/mkinitcpio.conf right?

Offline

#9 2009-03-02 18:12:27

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Kernel optimization

mkinitcpio.conf controls the configurable elements of the init image. The rest of it is common to all images created by mkinitcpio.

Offline

#10 2009-03-02 19:09:03

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: Kernel optimization

I can't compile my SATA drivers into the kernel, can only select them as 'M' in the kernel config. sad

CONFIG_ATA_PIIX:                                                                                              │  
  │                                                                                                               │  
  │ This option enables support for ICH5/6/7/8 Serial ATA                                                         │  
  │ and support for PATA on the Intel ESB/ICH/PIIX3/PIIX4 series                                                  │  
  │ host controllers.                                                                                             │  
  │                                                                                                               │  
  │ If unsure, say N.                                                                                             │  
  │                                                                                                               │  
  │ Symbol: ATA_PIIX [=m]                                                                                         │  
  │ Prompt: Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support                                                        │  
  │   Defined at drivers/ata/Kconfig:104                                                                          │  
  │   Depends on: ATA && ATA_SFF && PCI                                                                           │  
  │   Location:                                                                                                   │  
  │     -> Device Drivers                                                                                         │  
  │       -> Serial ATA (prod) and Parallel ATA (experimental) drivers (ATA [=m])                                 │  
  │         -> ATA SFF support (ATA_SFF [=y])

Offline

#11 2009-03-02 19:18:46

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: Kernel optimization

Are ATA && ATA_SFF && PCI  built into the kernel?

Offline

#12 2009-03-02 19:36:21

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: Kernel optimization

Zariel wrote:

Are ATA && ATA_SFF && PCI  built into the kernel?

Thanks, that was it wink

Offline

#13 2009-03-02 20:04:24

cerbie
Member
Registered: 2008-03-16
Posts: 124

Re: Kernel optimization

Fackamato wrote:

Can one live without an initrd on Arch?

Yes. Just make sure to compile in (not modules) your drive controller and file system drivers, and *viola* no initrd=imagefile needed.


"If the data structure can't be explained on a beer coaster, it's too complex." - Felix von Leitner

Offline

#14 2009-03-02 20:55:53

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: Kernel optimization

Then you can disable generation of initramfs images in your install and in your kconfig.

Offline

#15 2009-03-03 03:37:35

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,563

Re: Kernel optimization

_Real_ men don need no steenkin modules! initcpio's for noooobs!!! big_smile

Offline

#16 2009-03-03 17:48:06

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Kernel optimization

I never really got booting without initramfs to work :\ I don't mind modules anyways, so tongue

Offline

#17 2009-03-03 20:06:55

dunc
Member
From: Glasgow, UK
Registered: 2007-06-18
Posts: 559

Re: Kernel optimization

Themaister wrote:

I never really got booting without initramfs to work :\

Me neither. Mind you, I've never made much of an effort to figure out what was going wrong. I usually just think, "F**k it; modules aren't that bad," and rebuild. roll

And further to what others have said above, not building modules you don't need doesn't just save space, it saves time, too. The last couple of times I built a kernel here, I actually didn't expect it to boot because the compilation finished so quickly - I was sure something must have gone wrong somewhere.


0 Ok, 0:1

Offline

#18 2009-03-05 22:48:51

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Kernel optimization

Ye, that's as far as I'm concerned the best reason to remove modules. To save time for compilation big_smile harhar. Well. I've tried shaving off some obvious modules I don't need, but some places in the kernel config, I have no clue of what I can, or can not remove without breaking the kernel or usability of the system :\ I wish there was some tool to build a kernel config based on what hardware the program autodetects or something to give you an idea at least smile

Offline

#19 2009-03-05 22:57:37

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: Kernel optimization

Themaister wrote:

Ye, that's as far as I'm concerned the best reason to remove modules. To save time for compilation big_smile harhar. Well. I've tried shaving off some obvious modules I don't need, but some places in the kernel config, I have no clue of what I can, or can not remove without breaking the kernel or usability of the system :\ I wish there was some tool to build a kernel config based on what hardware the program autodetects or something to give you an idea at least smile

That should be (fairly) easy. Just do an lspci and match with the kernel config options. However, we need to compile some extra modules anyway, say, if you plug in your gamepad, or a camera, or something else. Or if you find you want to mess with NFS one day... or LVM.

Offline

#20 2009-03-06 21:53:12

dunc
Member
From: Glasgow, UK
Registered: 2007-06-18
Posts: 559

Re: Kernel optimization

NFS and LVM are fairly major changes that I probably wouldn't mind building a new kernel for (or use the stock kernel temporarily to get them up and running), but I always leave in pretty much every USB driver, because you never know what you might plug in. smile


0 Ok, 0:1

Offline

Board footer

Powered by FluxBB