# core 2 duo and kernel optimization settings

## dema

Hi all, I just bought an Intel Core 2 Duo  :Very Happy:  and I was asking me which were the best settings to use to optimize the kernel for this processor. 

In particular, I don't know which processor family to choose in the "Processor type and features" menu... I think pentium m should be a good choice (or maybe better pentium 4/pentium 4M/Xeon etc...?)

Any other ideas/suggestions about kernel optmization settings...?

Stefano

----------

## quag7

I use:

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

CHOST="x86_64-pc-linux-gnu"

MAKEOPTS="-j3"

You'll probably want to use the amd64 install.

Processor Family in the kernel is set to EM64T.

This has worked well for me on the Core 2 Duo (E6700) for the last few months

----------

## rolypoly

I'm curious about this too.

Given this topic from the GWN -> http://archives.gentoo.org/gentoo-amd64/msg_14402.xml

It certainly suggests using nocona if you've got a core 2 duo (as I do), but it also says you should use an amd64 profile.

Do I *have* to use an amd64 profile to benefit from -march=nocona?

I built my system a month ago using CHOST="i686-pc-linux-gnu" and -march=pentium-m

I didn't see the point in using amd64 since I've only got 2Gb of RAM (never thought I'd ever say *only* 2Gb RAM!   :Shocked:  )

Can I just change my -march to nocona and recompile over time, or should I start from scratch and select amd64 and -march=nocona from day one? What are the benefits of amd64 over i686 other than addressable memory?

Can someone enlighten me?

Thanks,

Roland.

----------

## dema

 *quag7 wrote:*   

> You'll probably want to use the amd64 install.
> 
> Processor Family in the kernel is set to EM64T.
> 
> This has worked well for me on the Core 2 Duo (E6700) for the last few months

 

Ok, and which is the best kernel setting for Processor type and family if I choose an x86 based system?

Thanks

Stefano

----------

## i13m

 *dema wrote:*   

>  which is the best kernel setting for Processor type and family if I choose an x86 based system?

 

The option I choose is:

```
Processor type and features --->

   Subarchitecture Type (PC-compatible)  --->

      Processor family (Pentium-4/Celeron(P4-based)/Pentium-4 M/Xeon)
```

If -march=nocona is the CFLAGS choose for Core 2 Duo under GCC at the moment ( 4.1 & 4.2 ), from http://archives.gentoo.org/gentoo-amd64/msg_14402.xml , then I think we should use the same option for the kernel configuration. Because Core 2 Duo is more likely to be Nocano than Pentium -m, lets kernel complie for it to get more profermances. However until GCC 4.3, which we can use -march=core2, we cannot get maximum from the Core 2 Duo processor.

Currently I am using:

 *Quote:*   

> CHOST="i686-pc-linux-gnu"
> 
> CFLAGS="-O2 -march=nocona -mfpmath=sse -pipe -fomit-frame-pointer"
> 
> CXXFLAGS="${CFLAGS}
> ...

 

on a Dell 6400 laptop.

----------

## bubbl07

 *dema wrote:*   

> Ok, and which is the best kernel setting for Processor type and family if I choose an x86 based system?
> 
> Thanks
> 
> Stefano

 

If you want to go x86, I would use

CFLAGS="-fomit-frame-pointer -march=prescott -O2 -pipe"(taken from the same GWN that rolypoly linked).

----------

## madisonicus

http://gentoo-wiki.com/Safe_Cflags#Intel_Core_2_Solo.2FDuo_.28Allendale.2C_Conroe.2C_Merom.29

 *Quote:*   

> 32 bit
> 
> CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
> 
> CXXFLAGS="${CFLAGS}"
> ...

 

----------

## natros

 *quag7 wrote:*   

> Processor Family in the kernel is set to EM64T.

 

EM64T?

i'm using v2.6.19-gentoo-r2 and i only have these:

386                                                

486                                                

586/K5/5x86/6x86/6x86MX                            

Pentium-Classic                                    

Pentium-MMX                                        

Pentium-Pro                                        

Pentium-II/Celeron(pre-Coppermine)                 

Pentium-III/Celeron(Coppermine)/Pentium-III Xeon   

Pentium M                                          

Pentium-4/Celeron(P4-based)/Pentium-4 M/Xeon       

K6/K6-II/K6-III                                    

Athlon/Duron/K7               

Opteron/Athlon64/Hammer/K8                         

Crusoe                                             

Efficeon                                           

Winchip-C6                                         

Winchip-2              

Winchip-2A/Winchip-3                               

GeodeGX1                                           

Geode GX/LX                                        

CyrixIII/VIA-C3                                    

VIA C3-2 (Nehemiah)          

i don't see any EM64T.

----------

## bubbl07

 *natros wrote:*   

> EM64T?
> 
> i'm using v2.6.19-gentoo-r2 and i only have these:
> 
> 386                                                
> ...

 

EM64T shows up in 64-bit kernels.

For a 32-bit environment, I'd choose the architecture with the most C2D-specific optimizations, in this case Pentium-4/Celeron (P4-based)/Pentium-4 M/Xeon.

----------

## dema

 *bubbl07 wrote:*   

> If you want to go x86, I would use
> 
> CFLAGS="-fomit-frame-pointer -march=prescott -O2 -pipe"(taken from the same GWN that rolypoly linked).

 

ok, but my question was more kernel related.... which processor type would be better to choose in the kernel configuration for an x86 based system...?

----------

## dema

 *madisonicus wrote:*   

> http://gentoo-wiki.com/Safe_Cflags#Intel_Core_2_Solo.2FDuo_.28Allendale.2C_Conroe.2C_Merom.29
> 
>  *Quote:*   32 bit
> 
> CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
> ...

 

same answer as above... my question was about kernel config...

----------

## dema

 *bubbl07 wrote:*   

> EM64T shows up in 64-bit kernels.
> 
> For a 32-bit environment, I'd choose the architecture with the most C2D-specific optimizations, in this case Pentium-4/Celeron (P4-based)/Pentium-4 M/Xeon.

 

ok... thanks for the answer

----------

