* [gentoo-user] Questions about CPU settings in kernel and USE
@ 2014-04-15 2:11 Walter Dnes
2014-04-15 14:42 ` David W Noon
2014-04-18 20:12 ` Andrew Savchenko
0 siblings, 2 replies; 9+ messages in thread
From: Walter Dnes @ 2014-04-15 2:11 UTC (permalink / raw
To: Gentoo Users List
I'm (re)installing Gentoo on an older AMD notebook. The output from
"less /proc/cpuinfo" includes...
processor : 1
vendor_id : AuthenticAMD
cpu family : 16
model : 6
model name : AMD Athlon(tm) II P320 Dual-Core Processor
stepping : 3
microcode : 0x10000b6
cpu MHz : 2100.000
cache size : 512 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 5
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 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock nrip_save
bogomips : 4189.59
TLB size : 1024 4K pages
Now for the questions
* In "make menuconfig", I'm not sure which of 2 CPU options to select in
Processor type and features --->
Processor family (*****************) --->
( ) Athlon/Duron/K7
( ) Opteron/Athlon64/Hammer/K8
Which one do I go with?
* I believe that "pni" == "sse3" (with *TWO* "s") Is that correct?
* The cpuinfo output shows "sse4a". Is that the same as the "sse4_1"
USE flag, or is it different
--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Questions about CPU settings in kernel and USE
2014-04-15 2:11 [gentoo-user] Questions about CPU settings in kernel and USE Walter Dnes
@ 2014-04-15 14:42 ` David W Noon
2014-04-15 18:33 ` Walter Dnes
2014-04-18 20:12 ` Andrew Savchenko
1 sibling, 1 reply; 9+ messages in thread
From: David W Noon @ 2014-04-15 14:42 UTC (permalink / raw
To: gentoo-user
On 15/04/14 03:11, Walter Dnes wrote:
[snip]
> model name : AMD Athlon(tm) II P320 Dual-Core Processor
This indicates a 64-bit processor.
[snip]
> 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 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock nrip_save
All these look plausible for an Athlon II.
[snip]
> * In "make menuconfig", I'm not sure which of 2 CPU options to select in
> Processor type and features --->
> Processor family (*****************) --->
>
> ( ) Athlon/Duron/K7
> ( ) Opteron/Athlon64/Hammer/K8
>
> Which one do I go with?
The second.
K7 = 32-bit Athlon, etc.
K8 = 64-bit Athlon II, etc.
> * I believe that "pni" == "sse3" (with *TWO* "s") Is that correct?
Yes: PNI = Prescott New Instructions, which became known as SSE3.
> * The cpuinfo output shows "sse4a". Is that the same as the "sse4_1"
> USE flag, or is it different
It is different. See <http://en.wikipedia.org/wiki/SSE4> for details.
The SSE4a instructions are specific to 64-bit AMD processors. AFAIAA,
there is no USE flag to enable them under Gentoo.
If you specify -march=k8 in your CFLAGS, you should get pretty decent
object code from GCC.
--
Regards,
Dave [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dwnoon@ntlworld.com (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Questions about CPU settings in kernel and USE
2014-04-15 14:42 ` David W Noon
@ 2014-04-15 18:33 ` Walter Dnes
2014-04-15 18:51 ` David W Noon
0 siblings, 1 reply; 9+ messages in thread
From: Walter Dnes @ 2014-04-15 18:33 UTC (permalink / raw
To: gentoo-user
Thanks for the info.
On Tue, Apr 15, 2014 at 03:42:31PM +0100, David W Noon wrote
> If you specify -march=k8 in your CFLAGS, you should get pretty decent
> object code from GCC.
I've used "-march=native" since it became available, because it's one
less thing to worry about. That's why I didn't ask about CFLAGS.
"echo | gcc -### -E - -march=native" spits out a whole bunch of
diagnostic output. In my case, it includes "-march=amdfam10", so
"-march=native" looks better.
--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Questions about CPU settings in kernel and USE
2014-04-15 18:33 ` Walter Dnes
@ 2014-04-15 18:51 ` David W Noon
0 siblings, 0 replies; 9+ messages in thread
From: David W Noon @ 2014-04-15 18:51 UTC (permalink / raw
To: gentoo-user
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tue, 15 Apr 2014 14:33:47 -0400, Walter Dnes
<mailto:dwnoon@ntlworld.com> (waltdnes@waltdnes.org) wrote about "Re:
[gentoo-user] Questions about CPU settings in kernel and USE" (in
<20140415183347.GA16109@waltdnes.org>):
> On Tue, Apr 15, 2014 at 03:42:31PM +0100, David W Noon wrote
>
>> If you specify -march=k8 in your CFLAGS, you should get pretty
>> decent object code from GCC.
>
> I've used "-march=native" since it became available, because it's
> one less thing to worry about. That's why I didn't ask about
> CFLAGS.
>
> "echo | gcc -### -E - -march=native" spits out a whole bunch of
> diagnostic output. In my case, it includes "-march=amdfam10", so
> "-march=native" looks better.
That's fine. The only thing is that many people use distcc to compile
packages for a laptop on a desktop or server, and -march=native
usually has different semantics on the server than on the laptop; thus
it is better in such a situation to specify the hardware architecture
explicitly.
If you're not using distcc, no problems should arise.
You should also check your CHOST setting to ensure you have
x86_64-pc-linux-gnu specified.
- --
Regards, Dave [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dwnoon@ntlworld.com
(David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlNNf50ACgkQRQ2Fs59Psv+tbwCgqwppw1+2j9SLQLGhcRVzyQ4G
7jgAmwc3DlJjPyf0SrmFnQ1R6CrX/t0X
=s2VQ
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Questions about CPU settings in kernel and USE
2014-04-15 2:11 [gentoo-user] Questions about CPU settings in kernel and USE Walter Dnes
2014-04-15 14:42 ` David W Noon
@ 2014-04-18 20:12 ` Andrew Savchenko
2014-04-18 23:16 ` Walter Dnes
2014-04-19 11:17 ` Volker Armin Hemmann
1 sibling, 2 replies; 9+ messages in thread
From: Andrew Savchenko @ 2014-04-18 20:12 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1693 bytes --]
On Mon, 14 Apr 2014 22:11:05 -0400 Walter Dnes wrote:
> I'm (re)installing Gentoo on an older AMD notebook. The output
> from "less /proc/cpuinfo" includes...
>
> processor : 1
> vendor_id : AuthenticAMD
> cpu family : 16
> model : 6
> model name : AMD Athlon(tm) II P320 Dual-Core Processor
> stepping : 3
> microcode : 0x10000b6
> cpu MHz : 2100.000
> cache size : 512 KB
> physical id : 0
> siblings : 2
> core id : 1
> cpu cores : 2
> apicid : 1
> initial apicid : 1
> fpu : yes
> fpu_exception : yes
> cpuid level : 5
> 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 3dnowext 3dnow constant_tsc
> rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt
> lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a 3dnowprefetch
> osvw ibs skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock
> nrip_save bogomips : 4189.59 TLB size : 1024 4K
> pages
>
> Now for the questions
>
> * In "make menuconfig", I'm not sure which of 2 CPU options to
> select in Processor type and features --->
> Processor family (*****************) --->
>
> ( ) Athlon/Duron/K7
> ( ) Opteron/Athlon64/Hammer/K8
I'd like to recommend you this kernel gcc patch which enables
-march=native support for kernel compilation:
https://github.com/graysky2/kernel_gcc_patch
Just select native and you will get both best performance and one
less headache.
Best regards,
Andrew Savchenko
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Questions about CPU settings in kernel and USE
2014-04-18 20:12 ` Andrew Savchenko
@ 2014-04-18 23:16 ` Walter Dnes
2014-04-19 6:52 ` Dragostin Yanev
2014-04-19 11:17 ` Volker Armin Hemmann
1 sibling, 1 reply; 9+ messages in thread
From: Walter Dnes @ 2014-04-18 23:16 UTC (permalink / raw
To: gentoo-user
On Sat, Apr 19, 2014 at 12:12:46AM +0400, Andrew Savchenko wrote
>
> I'd like to recommend you this kernel gcc patch which enables
> -march=native support for kernel compilation:
> https://github.com/graysky2/kernel_gcc_patch
>
> Just select native and you will get both best performance and one
> less headache.
I've been using "-march=native" for years. Is there any circumstance,
other than a really old gcc, where it doesn't work?
--
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Questions about CPU settings in kernel and USE
2014-04-18 23:16 ` Walter Dnes
@ 2014-04-19 6:52 ` Dragostin Yanev
0 siblings, 0 replies; 9+ messages in thread
From: Dragostin Yanev @ 2014-04-19 6:52 UTC (permalink / raw
To: gentoo-user
> On Sat, Apr 19, 2014 at 12:12:46AM +0400, Andrew Savchenko wrote
> >
> > I'd like to recommend you this kernel gcc patch which enables
> > -march=native support for kernel compilation:
> > https://github.com/graysky2/kernel_gcc_patch
> >
> > Just select native and you will get both best performance and one
> > less headache.
>
> I've been using "-march=native" for years. Is there any circumstance,
> other than a really old gcc, where it doesn't work?
>
Thank you Andrew I didn't know about this patch.
Walter,
the kernel uses it's own CFLAGS defined in the makefiles. This patch
adds some more options including "native"
Regards,
Dragostin Yanev
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Questions about CPU settings in kernel and USE
2014-04-18 20:12 ` Andrew Savchenko
2014-04-18 23:16 ` Walter Dnes
@ 2014-04-19 11:17 ` Volker Armin Hemmann
2014-04-19 11:58 ` Dragostin Yanev
1 sibling, 1 reply; 9+ messages in thread
From: Volker Armin Hemmann @ 2014-04-19 11:17 UTC (permalink / raw
To: gentoo-user
Am 18.04.2014 22:12, schrieb Andrew Savchenko:
> On Mon, 14 Apr 2014 22:11:05 -0400 Walter Dnes wrote:
>> I'm (re)installing Gentoo on an older AMD notebook. The output
>> from "less /proc/cpuinfo" includes...
>>
>> processor : 1
>> vendor_id : AuthenticAMD
>> cpu family : 16
>> model : 6
>> model name : AMD Athlon(tm) II P320 Dual-Core Processor
>> stepping : 3
>> microcode : 0x10000b6
>> cpu MHz : 2100.000
>> cache size : 512 KB
>> physical id : 0
>> siblings : 2
>> core id : 1
>> cpu cores : 2
>> apicid : 1
>> initial apicid : 1
>> fpu : yes
>> fpu_exception : yes
>> cpuid level : 5
>> 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 3dnowext 3dnow constant_tsc
>> rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt
>> lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a 3dnowprefetch
>> osvw ibs skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock
>> nrip_save bogomips : 4189.59 TLB size : 1024 4K
>> pages
>>
>> Now for the questions
>>
>> * In "make menuconfig", I'm not sure which of 2 CPU options to
>> select in Processor type and features --->
>> Processor family (*****************) --->
>>
>> ( ) Athlon/Duron/K7
>> ( ) Opteron/Athlon64/Hammer/K8
> I'd like to recommend you this kernel gcc patch which enables
> -march=native support for kernel compilation:
> https://github.com/graysky2/kernel_gcc_patch
>
> Just select native and you will get both best performance and one
> less headache.
or it creates code that is much slower or breaks in subtle and hard to
catch ways.
The kernel devs are very astute when it comes to gcc options - I
wouldn't screw around with them. If an app is crashy, disturbing but not
a big problem. If the kernel decides to write the wrong stuff all over a
partition boundary you are screwed.
>
> Best regards,
> Andrew Savchenko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] Questions about CPU settings in kernel and USE
2014-04-19 11:17 ` Volker Armin Hemmann
@ 2014-04-19 11:58 ` Dragostin Yanev
0 siblings, 0 replies; 9+ messages in thread
From: Dragostin Yanev @ 2014-04-19 11:58 UTC (permalink / raw
To: gentoo-user
> Am 18.04.2014 22:12, schrieb Andrew Savchenko:
> > On Mon, 14 Apr 2014 22:11:05 -0400 Walter Dnes wrote:
> >> I'm (re)installing Gentoo on an older AMD notebook. The output
> >> from "less /proc/cpuinfo" includes...
> >>
> >> processor : 1
> >> vendor_id : AuthenticAMD
> >> cpu family : 16
> >> model : 6
> >> model name : AMD Athlon(tm) II P320 Dual-Core Processor
> >> stepping : 3
> >> microcode : 0x10000b6
> >> cpu MHz : 2100.000
> >> cache size : 512 KB
> >> physical id : 0
> >> siblings : 2
> >> core id : 1
> >> cpu cores : 2
> >> apicid : 1
> >> initial apicid : 1
> >> fpu : yes
> >> fpu_exception : yes
> >> cpuid level : 5
> >> 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 3dnowext 3dnow constant_tsc
> >> rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt
> >> lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a 3dnowprefetch
> >> osvw ibs skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock
> >> nrip_save bogomips : 4189.59 TLB size : 1024 4K
> >> pages
> >>
> >> Now for the questions
> >>
> >> * In "make menuconfig", I'm not sure which of 2 CPU options to
> >> select in Processor type and features --->
> >> Processor family (*****************) --->
> >>
> >> ( ) Athlon/Duron/K7
> >> ( ) Opteron/Athlon64/Hammer/K8
> > I'd like to recommend you this kernel gcc patch which enables
> > -march=native support for kernel compilation:
> > https://github.com/graysky2/kernel_gcc_patch
> >
> > Just select native and you will get both best performance and one
> > less headache.
>
> or it creates code that is much slower or breaks in subtle and hard to
> catch ways.
>
> The kernel devs are very astute when it comes to gcc options - I
> wouldn't screw around with them. If an app is crashy, disturbing but not
> a big problem. If the kernel decides to write the wrong stuff all over a
> partition boundary you are screwed.
> >
> > Best regards,
> > Andrew Savchenko
>
>
Hi Volker Armin Hemmann,
Have you encountered -march=native related bugs? I haven't had any
problems on mainstream amd/intel cpus. With regards to the kernel I
would expect more problems from an aggressive -O flag than that of
-march since -march just indicates the instruction set the compiler can
use. That being said if the goal is stability I wouldn't be applying
unofficial patches.
Regards,
Dragostin Yanev
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-04-19 11:58 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15 2:11 [gentoo-user] Questions about CPU settings in kernel and USE Walter Dnes
2014-04-15 14:42 ` David W Noon
2014-04-15 18:33 ` Walter Dnes
2014-04-15 18:51 ` David W Noon
2014-04-18 20:12 ` Andrew Savchenko
2014-04-18 23:16 ` Walter Dnes
2014-04-19 6:52 ` Dragostin Yanev
2014-04-19 11:17 ` Volker Armin Hemmann
2014-04-19 11:58 ` Dragostin Yanev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox