View previous topic :: View next topic |
Author |
Message |
_______0 Guru
Joined: 15 Oct 2012 Posts: 521
|
Posted: Mon Apr 29, 2013 9:20 pm Post subject: newer AMD arch in kernel section? |
|
|
hi all,
There's a section in kernel config to specify cpu arch but I don't see anywhere newer amd option:
Code: | Processor type and features
--> Processor family (Generic-x86-64)
----> ( ) Opteron/Athlon64/Hammer/K8
( ) Intel P4 / older Netburst based Xeon
( ) Core 2/newer Xeon
( ) Intel Atom
(X) Generic-x86-64
|
Could it be that there aren't kernel optimizations for newer amd chips??
thanks. |
|
Back to top |
|
|
chithanh Developer
Joined: 05 Aug 2006 Posts: 2158 Location: Berlin, Germany
|
Posted: Tue Apr 30, 2013 9:21 am Post subject: |
|
|
These options mostly affect the compiler flags. You can edit the Makefiles and use kernel CFLAGS which are more specific to your CPU, but be aware that these are not tested well and may lead to unexpected results. |
|
Back to top |
|
|
aCOSwt Bodhisattva
Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Tue Apr 30, 2013 9:47 am Post subject: |
|
|
chithanh wrote: | You can edit the Makefiles and use kernel CFLAGS |
Use something like http://www.linuxforge.net/linux/kernel/kernel-33-gcc47-0.patch instead.
(Or at list as a guidance for which makefiles to modify.)
chithanh wrote: | may lead to unexpected results. |
Indeed, in many cases, -mtune=generic has been reported generating better code.
Of course, when kernel devs deliberatly make -march=core2 -mtune=generic, they know what they do.
BTW, as whatever you fiddle will end in ,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow... I fear that what you can expect from newer instruction sets will make the figures you obtain fall into the stdev of your benchmarks... that is to say :Un-noticeable ! _________________
|
|
Back to top |
|
|
darklegion Guru
Joined: 14 Nov 2004 Posts: 468
|
Posted: Tue Apr 30, 2013 12:46 pm Post subject: |
|
|
aCOSwt wrote: | chithanh wrote: | You can edit the Makefiles and use kernel CFLAGS |
Use something like http://www.linuxforge.net/linux/kernel/kernel-33-gcc47-0.patch instead.
(Or at list as a guidance for which makefiles to modify.)
chithanh wrote: | may lead to unexpected results. |
Indeed, in many cases, -mtune=generic has been reported generating better code.
Of course, when kernel devs deliberatly make -march=core2 -mtune=generic, they know what they do.
BTW, as whatever you fiddle will end in ,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow... I fear that what you can expect from newer instruction sets will make the figures you obtain fall into the stdev of your benchmarks... that is to say :Un-noticeable ! |
Does the kernel really disable SSE? Seems like this would be an issue with modern AMD processors at least, which don't natively support x87 instructions. |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Tue Apr 30, 2013 1:32 pm Post subject: |
|
|
The kernel doesn't use floating-point, and context switches to using vector registers are risky and expensive when it's the one that has to handle saving/restoring state. |
|
Back to top |
|
|
aCOSwt Bodhisattva
Joined: 19 Oct 2007 Posts: 2537 Location: Hilbert space
|
Posted: Tue Apr 30, 2013 4:20 pm Post subject: |
|
|
darklegion wrote: | Does the kernel really disable SSE? Seems like this would be an issue with modern AMD processors at least, which don't natively support x87 instructions. |
It actually does : /usr/src/linux/arch/x86/Makefile wrote: | # prevent gcc from generating any FP code by mistake
KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,) |
As Ant P. wrote, the kernel does not like floating point, it always prefer working like this :
Code: | int fref, temp, fout, mfd;
temp = 100 * fsys / fref;
mfd = 4 * BUSDIV * temp / 100; |
_________________
|
|
Back to top |
|
|
|