You are not logged in.

#1 2008-10-01 17:28:40

Poisonblack
Member
From: Mumbai, India
Registered: 2008-07-25
Posts: 46

Recompiling kernel to improve performance: HOW.?

Hi.!
I am a total newbie to Linux kernel.I have the pacman-provided kernel 2.6.26-5 running at the moment.
I happened to hear that recompiling the kernel for your hardware speeds up your OS tremedously.So, I tried searching the net for some tuts on recompiling kernel but I guess it's different in Arch due to ABS.?
Now I need to know the following:

-->Some nice guide on compiling kernel for your hardware on Arch.

-->What is the gain in terms of speed/response time between generic kernel and custom-compiled kernel.?Is it worth the effort.?

-->How much time should recompiling the kernel take.?

I want to retain my current kernel and add a GRUB entry to boot Arch using custom kernel.Is that possible .?

Thanks and sorry for being such a n00b.! lol


It's a miracle that curiosity survives formal education.

Offline

#2 2008-10-01 17:51:13

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Recompiling kernel to improve performance: HOW.?

Whoever told you that is wrong - in general, anyway. It's very unlikely to be worth the effort, unless you need some specific patch. Don't forget the kernel parameters that can be specified in grub.

My custom kernel takes about 90 seconds to compile, using all 4 CPU cores.

Offline

#3 2008-10-01 19:37:54

Shagbag
Member
Registered: 2006-10-25
Posts: 259

Re: Recompiling kernel to improve performance: HOW.?

-->Some nice guide on compiling kernel for your hardware on Arch.

Read The Friendly Manual:
Kernel Compilation from Source
Kernel Compilation with ABS
... and if you want the Full Monty: Greg Kroah-Hartman's book

-->What is the gain in terms of speed/response time between generic kernel and custom-compiled kernel.?Is it worth the effort.?

This may give you an idea: Mandriva's experience.  I got a circa. 7 second reduction in boot time when using a custom kernel on my Acer Aspire One,

-->How much time should recompiling the kernel take.?

Q: How long is a piece of string?
A: 20+ minutes depending upon the configuration and your hardware.

I want to retain my current kernel and add a GRUB entry to boot Arch using custom kernel.Is that possible .?

Yes.  Look at the PKGBUILD example in the abovelinked 'Kernel Compilation from Source' and see how the '-my' suffix is added in some key lines.

Thanks and sorry for being such a n00b.! lol

np. We were all (and some still are) n00bs once.

Last edited by Shagbag (2008-10-01 19:43:45)

Offline

#4 2008-10-01 19:46:40

haxit
Member
From: /home/haxit
Registered: 2008-03-04
Posts: 1,247
Website

Re: Recompiling kernel to improve performance: HOW.?

I brushed off about 8 seconds on my boot time. The wiki guides are great also.

@ brebs: How does it take 90 seconds :S


Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.

Offline

#5 2008-10-01 20:26:14

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Recompiling kernel to improve performance: HOW.?

haxit wrote:

How does it take 90 seconds

OK I exaggerated slightly. Exact:

$ time compilekernel
real    2m15.166s
user    1m10.669s
sys    0m25.955s

But that includes making it live in grub, which in Fedora 9 involves reading the CD drive for some unknown reason (which adds a delay of about 4 seconds while it spins up).

Of course, I'm compiling only what I need, and using all 4 cores (with the excessive "make -j8") of a quad-core Q6600 CPU.

Here's my horribly messy compilekernel script.

Offline

#6 2008-10-01 20:26:53

haxit
Member
From: /home/haxit
Registered: 2008-03-04
Posts: 1,247
Website

Re: Recompiling kernel to improve performance: HOW.?

brebs wrote:
haxit wrote:

How does it take 90 seconds

OK I exaggerated slightly. Exact:

$ time compilekernel
real    2m15.166s
user    1m10.669s
sys    0m25.955s

But that includes making it live in grub, which in Fedora 9 involves reading the CD drive for some unknown reason (which adds a delay of about 4 seconds while it spins up).

Of course, I'm compiling only what I need, and using all 4 cores (with the excessive "make -j8") of a quad-core Q6600 CPU.

Here's my horribly messy compilekernel script.

Awesome ;D

I have a questions, what should I put for dual core? -j3?

Last edited by haxit (2008-10-01 20:28:34)


Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.

Offline

#7 2008-10-02 08:14:18

Poisonblack
Member
From: Mumbai, India
Registered: 2008-07-25
Posts: 46

Re: Recompiling kernel to improve performance: HOW.?

Downloading the kernel source right now.
Just a quick question..For kernel 2.6.26.5, should the PKGVER in PKGBUILD be 2.6.26 or 2.6.26.5 ?


It's a miracle that curiosity survives formal education.

Offline

#8 2008-10-02 08:30:16

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Recompiling kernel to improve performance: HOW.?

haxit wrote:

dual core? -j3?

Can do. Maybe -j2 will make the PC usable whilst the compilation occurs, if -j3 makes it unresponsive. It's personal preference.

Offline

#9 2008-10-05 01:53:44

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: Recompiling kernel to improve performance: HOW.?

"Maybe -j2 will make the PC usable whilst the compilation occurs, if -j3 makes it unresponsive. "
why would compiling kernel with -j3 on dual core make box non responsive?

-j(cpu+1) rule is a myth
GNU is able to optimize job number of jobs run in parallel if run
make -j
without limiting value but this will actually slow down compilation process because of disk access (will work with swap in RAM)
on dualcore I never had a problem with
make -j6 bzImage
while doing a lot of different things:
time make -j6 bzImage
real    3m35.827s
user    5m49.870s
sys     0m34.453s

I doubt that dualcore system would become unresponsive with -j8

Offline

#10 2008-10-05 07:14:11

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Recompiling kernel to improve performance: HOW.?

"Unresponsive" means *slow* and tedious to use. Try this simple test: Run apps that take up 100% CPU - one for each core. Then watch the mouse be jerky when moved.

Offline

#11 2008-10-06 00:21:07

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: Recompiling kernel to improve performance: HOW.?

please..

anyway, compiling kernel on dualcore with -j8 option does not affect system responsiveness.
in fact you are limiting number of concurrent jobs.
run with unlimited number of jobs "-j" then your system may became jerky.

Offline

Board footer

Powered by FluxBB