# Is this optimal setup? Kernel + make.conf

## kbzium

I don't know if I'm getting as much as I should from my current setup. Therefore I'd like to ask you to help me check it  :Smile: . Here're most important files:

.config

http://bpaste.net/show/51334/

make.conf

http://bpaste.net/show/51335/

My setup:

i7 2600 sandy bridge

8GB ram 1600MHz

GF GTX 560 Ti

Extreme 3 Gen 3 (z68 chipset)

Thanks! I'm new to gentoo.

----------

## slugggerzzz

32 bit profile (x86)

CHOST="i686-pc-linux-gnu"

CFLAGS="-march=prescott -O2 -fomit-frame-pointer -pipe"

CXXFLAGS="${CFLAGS}"

64 bit profile (amd64) for < GCC 4.3

CHOST="x86_64-pc-linux-gnu"

CFLAGS="-march=nocona -O2 -pipe"

CXXFLAGS="${CFLAGS}"

64 bit profile (amd64) for GCC 4.3

CHOST="x86_64-pc-linux-gnu"

CFLAGS="-march=core2 -mtune=generic -O2 -pipe"

CXXFLAGS="${CFLAGS}"

64 bit profile (amd64) for GCC 4.6

CHOST="x86_64-pc-linux-gnu"

CFLAGS="-march=corei7 -O2 -pipe"

CXXFLAGS="${CFLAGS}"

Should make some difference. 

found off http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel

Also you should be okay upping your MAKEOPTS value, my i7 copes fine with more.

----------

## d2_racing

Where did you took this combo :

MAKEOPTS="-j9 -l16"

I tought that the -j stuff must match with the -l stuff.

I'm waitting for this CPU : http://www.intel.fr/content/www/fr/fr/benchmarks/desktop/3rd-gen-core-i7-3770.html

So, what should I use :

MAKEOPTS="-j9 -l16" or something even higher ?

Thanks  :Razz: 

----------

## kbzium

 *slugggerzzz wrote:*   

> 32 bit profile (x86)
> 
> CHOST="i686-pc-linux-gnu"
> 
> CFLAGS="-march=prescott -O2 -fomit-frame-pointer -pipe"
> ...

 

You have a goot point i think with that CFLAGS and GCC version. I've created new thread addressing this issue here https://forums.gentoo.org/viewtopic-t-939708.html so it could easily by found by others. Back to this thread - what about kernel config?

----------

## khayyam

 *slugggerzzz wrote:*   

> [SNIP various CFLAGS] [s]hould make some difference.  found off http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel

 

slugggerzzz ... -march=native will provide the optimal flags for the host cpu, so providing -march=core2 will make no difference whatsoever. You can check ...

```
gcc '-###' -e -v -march=native /usr/include/stdlib.h
```

Also, gentoo-wiki.com is often incorrect, and is not a gentoo project.

kbzium ... asking such open questions is generally the wrong way to go about improving your setup. I can see some things I'd probably change in your .config, but such changes might not be the best for you, meaning, I don't know the circumstances under which you may have enabled them. So, its best to be specific, vague questions tend to invite vague replies.

best ... khay

----------

## ulenrich

 *khayyam wrote:*   

> ... -march=native will provide the optimal flags for the host cpu, so providing -march=core2 will make no difference whatsoever.

   The difference is:

- core2 will enable the minimal feature set of the core2 processor family. 

- native will enable even better cpu flags if available

It is no magic: The "native" keyword activates the compiler to do an extra inspection of 

/proc/cpuinfo (or similar sysinfo). The effect of self-activated processor flags might be a (very little) performance boost of gcc as the compiler does not have to self inspect every now and then. But if you set them wrongly ....  :Sad: 

Funny effect I observed: If I additionally set "-tune=native" the cpu flags get set worse. That effect might be a gcc bug...

----------

## khayyam

 *ulenrich wrote:*   

>  *khayyam wrote:*   ... -march=native will provide the optimal flags for the host cpu, so providing -march=core2 will make no difference whatsoever. 
> 
> The difference is:
> 
> - core2 will enable the minimal feature set of the core2 processor family. 
> ...

 

ulenrich ... what is your point? sluggerzzz wrote "[bunch of CFLAGS] [s]hould make some difference", and that is what I'm responding to.

Unless -march=native is wrong (which is fairly rare, though happend in my case) then the best option is to use -march=native, and that is precisely what kbzium has set before being offered advice to the contrary.

best ... khay

----------

## kbzium

 *ulenrich wrote:*   

>  *khayyam wrote:*   ... -march=native will provide the optimal flags for the host cpu, so providing -march=core2 will make no difference whatsoever.   The difference is:
> 
> - core2 will enable the minimal feature set of the core2 processor family. 
> 
> - native will enable even better cpu flags if available
> ...

 

What about having it disabled in kernel?

----------

## ulenrich

 *khayyam wrote:*   

>  *ulenrich wrote:*    *khayyam wrote:*   ... -march=native will provide the optimal flags for the host cpu, so providing -march=core2 will make no difference whatsoever. 
> 
> The difference is:
> 
> - core2 will enable the minimal feature set of the core2 processor family. 
> ...

 

No, you are correct! It is the best!

There only is a little difference, I thought I could explain. But using my bad english style  ...

----------

## kbzium

 *khayyam wrote:*   

> 
> 
> kbzium ... asking such open questions is generally the wrong way to go about improving your setup. I can see some things I'd probably change in your .config, but such changes might not be the best for you, meaning, I don't know the circumstances under which you may have enabled them. So, its best to be specific, vague questions tend to invite vague replies.
> 
> 

 

But maybe there is some list containing crucial to performance (or just slightly important) kernel options? I tired to search through it myself (option by option) but I turned out, that if some options are off, I don't see other ones... So its so tangled up...

----------

## John R. Graham

kbzium, do you know about Pappy's Kernel Seeds? These are expertly-prepared basic .config files onto which you add your specific hardware settings. They're a very good place to start.

- John

----------

## Thistled

```
-march=native 
```

is the way to go.

----------

## khayyam

 *kbzium wrote:*   

>  *khayyam wrote:*   ... asking such open questions is generally the wrong way to go about improving your setup. I can see some things I'd probably change in your .config, but such changes might not be the best for you, meaning, I don't know the circumstances under which you may have enabled them. So, its best to be specific, vague questions tend to invite vague replies. 
> 
> But maybe there is some list containing crucial to performance (or just slightly important) kernel options? I tired to search through it myself (option by option) but I turned out, that if some options are off, I don't see other ones... So its so tangled up...

 

kbzium ... but your question is at best vague, "here is my .config ... what is my optimal setup?" Your asking that we go through your config item by item and suggest improvements when you have provided little or no information as to why the .config is the way it is, that is, why a specific option was chosen. Its a big ask ... for all you know this configuration may be optimal, and unless there is a problem you can point to (that is, narrow the focus) then you are really expecting something more than support, your expecting a tutorial.

Here is an example, why is CONFIG_CC_OPTIMIZE_FOR_SIZE=y set, by default it is =n, so why is it currently enabled. The help says "If unsure, say Y" but actually this option (in my experience, and from what I have read elsewhere) will cause sub-optimal performance. The only reason I can see for using "-Os" is if the OS is limited diskspace wise, so I would say it was a bad idea to enable it. That said, I don't know why you decided to enable it, maybe your boot partition is particularly small, or you read the words "OPTIMIZE" and thought, yeah, sounds like a good idea. So, context is everything.

A second example, you have CONFIG_USB_DEBUG=y, perhaps this provides information you need when a USB device is attatched, I would generally only ever have debug enabled if I have a problem with something as I don't want logfiles filled up with endless, and often useless, information.

So, the context is important here. I could say get rid of X, Y and Z ... but such advice would be at best vague, and as I said, "vague questions tend to invite vague replies". That taken into consideration I can anounce that your config is absolutely perfect ...

best ... khay

----------

## John R. Graham

To elaborate on what khayyam said about the CONFIG_CC_OPTIMIZE_FOR_SIZE option, the built-in kernel advice ("If unsure, say Y) isn't so much wrong as out of date. On older processors with very small cache, -Os sometimes made faster running code because the smaller code would result in less cache misses, even though the generated code was slower in non-wait-stated cycles. Your i7 definitely doesn't qualify as an older, smaller cache processor. So much of the tweaking you're asking about is nuanced like that.

- John

----------

## ulenrich

A good example what an expert team can achieve performance wise:

http://www.phoronix.com/scan.php?page=news_item&px=MTIwNzM

Only special case postgresql ... There are special cases you can optimize though. And look at the filesystem differences mesured at that phoronix site!

----------

## kbzium

@kyayyam

You're right, I was vague... but I'm seeking my best kernel config and I didn't know where to start. You've told me so it's okay now  :Smile: 

But tell mi one more thing:

Why according to this:

http://kernel-seeds.org/seeds/64_bit/gentoo/

why there is kernel 3.6.2 while emerge -av dev-kernel/gentoo-sources tells me it's 3.4.9? I'm about to upgrade from 3.3.8 now, so I'm wondering its the newest stable  :Smile: 

Also I'd like to compare both files (my config and that 3.4.9 config from this site), but diff fileA fileB produces strange result (1700 lines...). Is there a better solution?

ThanksLast edited by kbzium on Tue Oct 16, 2012 4:50 pm; edited 1 time in total

----------

## GFCCAE6xF

@kbzium

http://packages.gentoo.org/package/sys-kernel/gentoo-sources

Here you can see what is marked stable and what is not for your arch.

----------

## khayyam

 *kbzium wrote:*   

> You're right, I was vague... but I'm seeking my best kernel config and I didn't know where to start. You've told me so it's okay now

 

kbzium ... heh, indeed, but seriously had I just said, "the config is perfect" that too would have been vague (which is really all I was illustrating).

 *kbzium wrote:*   

> why there is kernel 3.6.2 while emerge -av dev-kernel/gentoo-sources tells me it's 3.4.9? I'm about to upgrade from 3.3.8 now, so I'm wondering its the newest stable

 

gentoo packages don't necessarily follow upstream in what is considered 'stable', so though 2.6.2 is listed as 'stable' on kernel.org this doesn't reflect what packages are 'stable' in the portage tree. However, if there is a feature, or bugfix, that is not included in 3.4.9, you can keyword 3.6.2. I'm currently using 3.6.2 without issues. 

 *kbzium wrote:*   

> Also I'd like to compare both files (my config and that 3.4.9 config from this site), but diff fileA fileB produces strange result (1700 lines...). Is there a better solution?

 

hmmm ... this sounds about right, in my case the output is 2203 lines, but a great many of these lines are 'context' lines (provided by diff) showing where the files differ, and if they differ then both the lines will be included (ie: for =m or =y), so there probably won't be that many options that need to be compared. Besides, all a seed does is provide the bare minimum config to build from, it doesn't provide an optimal .config.

best ... khay

----------

