Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
setting the /etc/portage/make.conf flags
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
DavidLee1A
n00b
n00b


Joined: 30 May 2013
Posts: 9

PostPosted: Thu May 30, 2013 3:47 pm    Post subject: setting the /etc/portage/make.conf flags Reply with quote

a portion of cat /proc/cpuinfo generates:
Code:

processor   : 5
vendor_id   : AuthenticAMD
cpu family   : 21
model      : 1
model name   : AMD FX(tm)-6200 Six-Core Processor             
stepping   : 2
microcode   : 0x6000626
cpu MHz      : 1400.000
cache size   : 2048 KB
physical id   : 0
siblings   : 6
core id      : 5
cpu cores   : 3
apicid      : 21
initial apicid   : 5
fpu      : yes
fpu_exception   : yes
cpuid level   : 13
wp      : yes
flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 nodeid_msr topoext perfctr_core arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bogomips   : 7580.85
TLB size   : 1536 4K pages
clflush size   : 64
cache_alignment   : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate [9]

In addition to -march=athlon64 -O2 -pipe will I also set -msse -msse2 -msse3 -mmmx -md3now ? How does one know when setting flags reaches the point where it will negatively impact performance?
Back to top
View user's profile Send private message
GFCCAE6xF
Apprentice
Apprentice


Joined: 06 Aug 2012
Posts: 266

PostPosted: Thu May 30, 2013 4:03 pm    Post subject: Reply with quote

I don't think you will have to specify the extras.
I read a while ago that march=native or other specific cpu type automatically uses things like sse if available but if you use one of many commands to see what march will enable for you, things like various sse's get shown as disabled even though really they are not, so you do not need to set them manually.

Edit:
Of course I mean sse plus everything else in the flags list for your cpu; basically, go with -march=athlon64 -O2 -pipe and everything supported will be used.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6281

PostPosted: Thu May 30, 2013 5:44 pm    Post subject: Reply with quote

rorgoroth wrote:
basically, go with -march=athlon64 -O2 -pipe and everything supported will be used.

This is certainly false.

Maybe -march=native will set all necessary sse 3dnow etc flags, but it depends on the compiler version. You do not lose anything if you set it.
Quote:
How does one know when setting flags reaches the point where it will negatively impact performance?

Why do you think that flags describing hardware possibilities will have a negative performance impact? Of course, there might always be perticular cases where a particular code leads to a break of some processor-internal pipeline, but this can also happen the other way around. Usually, generating "more native" code to the processor should be only advantageous.
Back to top
View user's profile Send private message
DavidLee1A
n00b
n00b


Joined: 30 May 2013
Posts: 9

PostPosted: Fri May 31, 2013 1:26 pm    Post subject: Reply with quote

Thank you for responding. I was referring to comments in the manual:
Quote:
too much optimization can make programs behave bad (crash, or even worse, malfunction)
and in other documentation similar warnings were mentioned.
I am up to choosing, installing, configuring, and compiling the kernel source. Any advice on the Linux Kernel stage (7 in the manual) would be welcome.
Back to top
View user's profile Send private message
GFCCAE6xF
Apprentice
Apprentice


Joined: 06 Aug 2012
Posts: 266

PostPosted: Fri May 31, 2013 3:28 pm    Post subject: Reply with quote

mv wrote:
rorgoroth wrote:
basically, go with -march=athlon64 -O2 -pipe and everything supported will be used.

This is certainly false.

*facepalm*
Sorry, you are correct. Usually I am a preacher of native :wink:

@DavidLee1A
I'm not sure what advice you want, you can use genkernel to make "full" kernel that is guaranteed to work so that you can get around to slimming and personalizing it for you later. You should check out pappy_mcfae's kernel seeds: http://kernel-seeds.org/ & https://forums.gentoo.org/viewtopic-t-942572.html
Back to top
View user's profile Send private message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2805
Location: Oceanside, Ca

PostPosted: Fri May 31, 2013 4:30 pm    Post subject: Reply with quote

These are not proper USE flags

" 3dnowprefetch abm aes aperfmperf apic arat avx clflush cmov cmp_legacy constant_tsc cpb cr8_legacy cx16 cx8 de decodeassists extapic extd_apicid flushbyasid fma4 fpu fxsr fxsr_opt ht hw_pstate ibs lahf_lm lbrv lm lwp mca mce misalignsse monitor msr mtrr nodeid_msr nonstop_tsc nopl npt nrip_save nx osvw pae pat pausefilter pclmulqdq pdpe1gb perfctr_core pfthreshold pge pni popcnt pse pse36 rdtscp rep_good sep skinit sse4_1 sse4_2 sse4a svm svm_lock syscall topoext tsc tsc_scale vmcb_clean vme wdt xop xsave xsave"

hielvc

Edit: Sorted the list then pasted the wrong list in duh.
_________________
An A-Z Index of the Linux BASH command line


Last edited by hielvc on Fri May 31, 2013 5:44 pm; edited 2 times in total
Back to top
View user's profile Send private message
TomWij
Retired Dev
Retired Dev


Joined: 04 Jul 2012
Posts: 1553

PostPosted: Fri May 31, 2013 5:15 pm    Post subject: Reply with quote

mv wrote:
Maybe -march=native will set all necessary sse 3dnow etc flags, but it depends on the compiler version. You do not lose anything if you set it.


This. Go for the most recent stable compiler, set -march=native -O2 -pipe and don't bother; the compiler developers usually know better than the figuring out you're trying to do, the native march option has well improved over time. That being said, if you're running in a specific server hardware or certain virtualization settings you should inspect whether it guesses things right; some need parameters like -mno-avx to avoid generation of illegal instructions, just a rather specific example of how it can go wrong in odd occasions.
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6281

PostPosted: Fri May 31, 2013 6:56 pm    Post subject: Reply with quote

DavidLee1A wrote:
Thank you for responding. I was referring to comments in the manual:
Quote:
too much optimization can make programs behave bad (crash, or even worse, malfunction)
and in other documentation similar warnings were mentioned.

This is a leftover from experiences with people who used to set dozens of flags like -funroll-all-oops without understanding what they are doing and why these flags are not necessarily good: Especially unexperienced users wanting to "tune" their system sometimes have actually decreased its speed and stability.
Hardware flags like -mss* should not fall into this cateogry (although, however, you can never be absolutely safe from software or compiler bugs anyway. For instance, some versions of gcc and firefox just crashed with the optimized -march=pentium3, although, usually, there is nothing wrong with that flag).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum