# Genkernel vs. manual kernel config

## audiodef

Has anyone benchmarked genkernel vs. manual kernel config? Is one faster, more memory efficient, etc., than the other? 

(I'm ignoring kernel size on disk or length of time it takes to compile.)

----------

## Roman_Gruber

experimental use flag allows march settings, e.g. ivybride march for my q3610qm cpu.

manual build kernel with experimntal useflag + march ivybridge had some impact, comparing libreoffice built times before and after the change.

I repeated that to verify it and it was everytime faster as before. I also checked different packages

----------

## TigerJr

 *audiodef wrote:*   

> Has anyone benchmarked genkernel vs. manual kernel config? Is one faster, more memory efficient, etc., than the other? 
> 
> (I'm ignoring kernel size on disk or length of time it takes to compile.)

 

It depend on what you do with this kernel, if you experienced with manual configuration you can make many needed function faster and turn off unneeded function and drivers (kernel size is easy to analyze i.e. fast boot, and all function and drivers need size and time to load, big sized and heavy function with many operation and cpu instruction works slower), if you not experienced with manual configuration, than you can't turn off unneeded function and even have faced with kernel panics or your kernel would slower or unbootable, that pushes you to use genkernel or already compiled kernel.

----------

## szatox

 *Quote:*   

> Has anyone benchmarked genkernel vs. manual kernel config? Is one faster, more memory efficient, etc., than the other?
> 
> (I'm ignoring kernel size on disk or length of time it takes to compile.)

 You ignore the build-time stuff... So, you can launch make manually or have genkernel launch it for you.

In both cases you use gcc and kernel's .config. If your configs (and low-level compiler flags) match, you should get the same result. So... What do you want to benchmark against what, and what is the point?

----------

## Tony0945

Are you comparing apples and apples?  Manual configuration versus genkernel with the same kernel configuration?

It sounds like you are asking about manual configuration versus stock configuration. Genkernel is just a script to do the steps without manually typing them in.  The only real difference is that genkernel doesn't forget to copy the kernel to /boot or to update the boot menu. The one weakness is that it requires an intitramfs. If you are using one anyway, there is no reason not to use genkernel.

I stopped using genkernel but only because I've ditched the initramfs.

It would be interesting to bench mark a hand kernel against the same config as built with an initramfs by genkernel.

To do it you would build the hand kernel, save the config to <my saved config>  then run "genkernel --config=<my saved config> all". You can't leave it in /usr/src/linux/.config because genkernel overwrites it.

Easy enough to do, but the benchmarking procedure needs more thought.

----------

## audiodef

I'm interested in how efficiently a genkernel kernel, created with "genkernal all" and no specific options, runs (don't care about compile times for anything) compared to the same kernel sources carefully compiled manually for the same system, with anything not needed by the system removed. Is there a real difference? 

But I've decided to perform a comparison myself on the particular system I have in mind. That seems the best way to decide if I want to recommend genkernel as an option for Gentoo Studio.

----------

## NeddySeagoon

audiodef,

Other than building and loading modules you don't need, there should be no execution time differences.

Its the same code in both cases.  The difference is in the unneeded baggage.

I'll be interested in your results though.

----------

## Roman_Gruber

regarding build times.

i used for years

make && make modules_install

because it was in the guides and i never cared, or read the man-page

last year i read the manpage and there is the --jobs option. was kinda annoyed to see it taking a very long time. checked i7z tool and saw only one core in use.

you need to look it up yourself but it is something like, for 3610qm (when you want full hyperthreading in use), load should be around 8 or 9 than. my personal opinion is to keep the load between 8 and 9. because it is a quadcore cpu with hyperthreading. ... i7z tells a bit on how the cores are utilized.

make --jobs 10 && make --jobs 10 modules_install

as said check the manpage, how the syntxx for the job option is

when you build a kernel, you need to consider for a desctop box you want a responsive box. I had a few kernels built which were slight faster, but when the box was unresponsive to the user, it is kinda worthless. 

except the experimental useflag and ivybridge option, i hardly got any tweaks which showed some impacts.

----------

## bstaletic

Regarding performance, I see no difference. Regarding battery life, it's more than noticeable.

----------

## Tony0945

 *tw04l124 wrote:*   

> i used for years
> 
> make && make modules_install

 

My build script

```
X3 ~ # cat `which buildmykernel`

#!

cd /usr/src/linux

zcat /proc/config.gz >.config

# At this point we should compare kernel versions and make oldconfig if the base version has updated

make menuconfig   &&  make -j7 && make -j7 modules_install && make -j7 install && echo "Don't forget to update boot loader menu"

```

The && parts aren't working quite right. I can have build errors and the next stage continues anyway.  I copied this from a six core box, I should change it to j4 on the box I ran from because it's a three core. Builds run fast anyway.

----------

## Syl20

 *Tony0945 wrote:*   

> The && parts aren't working quite right. I can have build errors and the next stage continues anyway.

 

```
make -jx && make -jx modules_install install
```

 works well for me. I see warnings, but no errors.

As "make install" updates the symlinks, I don't need to update the boot menu (but I don't use the awful grub-fat-menu-makin' scripts at all). But I should add a "emerge @module-rebuild" warning, it's a task I often forget.

----------

## The Main Man

 *Tony0945 wrote:*   

> The one weakness is that it requires an intitramfs. 
> 
> I stopped using genkernel but only because I've ditched the initramfs.
> 
> 

 

And that is weakness why exactly ?

Boot time speed or something else ?

----------

## szatox

Oh, genkernel does not enforce using initramfs. It builds one, but adding the path to kernel's command line is up to you.

You can ignore it, unless you particular setup requires it. (like root on LVM)

----------

## Tony0945

 *szatox wrote:*   

> Oh, genkernel does not enforce using initramfs. It builds one, but adding the path to kernel's command line is up to you.
> 
> You can ignore it, unless you particular setup requires it. (like root on LVM)

 

I didn't realize that. Genkernel adds the line and I assumed it needed it.

So they only reason not to use genkernel is "real men type everything by hand".

----------

## Tony0945

 *CneGroumF wrote:*   

>  *Tony0945 wrote:*   The && parts aren't working quite right. I can have build errors and the next stage continues anyway. 
> 
> ```
> make -jx && make -jx modules_install install
> ```
> ...

 

Works well for me too, but sometimes it fails to make bzimage but goes merrily on without returning non-zero so at the end the script ran but there is no vmlinuz in /boot.

It's not the fault of the script that the build fails, but it should stop, but doesn't. If you scroll through the messages you see the compilation failure. The script should stop.

----------

## Roman_Gruber

the issue is, there is hardly no benefit in the way how you do it.

and as you mentioned you hardly get a feedback.

I am not sure if this is a bash feature, quoting from my i3.config

```
scrot '%d-%m-%Y_%H:%M:%S_screenshot.png' -e 'mv $f ~/Screenshots/'
```

AFAIk those % ... makes it easy to give a date stamp to your file-name. you may use that too.

and serious, you ask for issues when you do not type those make commands yourself and change the kernel yourself. and even do not rename the kernel yourself. 

When you have not a proper kernel, your box will not boot or has other issues. it is a critical component, and that's why id o it by hand.

linux mint, the idiots of scripting, destroyed several of my boxes with their automated grub sripts ... only because someone coded something, does not mean it is foolproof or was written with every possible case in mind. or does even consider a valid grub entry to keep it. 

portage is the best example to show how limited scripting is. (endless topics on how to improve portage or the flaws of it)

..

i always wanted to learn or improve my bash coding. 

you may check for a return value of your function. it may exists. and than you can evaluate that return value before continuing.

----------

## audiodef

 *NeddySeagoon wrote:*   

> audiodef,
> 
> Other than building and loading modules you don't need, there should be no execution time differences.
> 
> Its the same code in both cases.  The difference is in the unneeded baggage.
> ...

 

Yeah, it does seem like there should be no performance difference. Genkernel might actually be good for Gentoo Studio, as it seems it would give the user a higher chance of all necessary modules for supported audio hardware being loaded than if the user does it manually and overlooks something.

----------

