Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
newer AMD arch in kernel section?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
_______0
Guru
Guru


Joined: 15 Oct 2012
Posts: 521

PostPosted: Mon Apr 29, 2013 9:20 pm    Post subject: newer AMD arch in kernel section? Reply with quote

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
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 1562
Location: Berlin, Germany

PostPosted: Tue Apr 30, 2013 9:21 am    Post subject: Reply with quote

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
View user's profile Send private message
aCOSwt
Moderator
Moderator


Joined: 19 Oct 2007
Posts: 2375
Location: Hilbert space

PostPosted: Tue Apr 30, 2013 9:47 am    Post subject: Reply with quote

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 ! :twisted:
_________________
Back to top
View user's profile Send private message
darklegion
Guru
Guru


Joined: 14 Nov 2004
Posts: 466

PostPosted: Tue Apr 30, 2013 12:46 pm    Post subject: Reply with quote

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 ! :twisted:


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
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2204
Location: UK

PostPosted: Tue Apr 30, 2013 1:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
aCOSwt
Moderator
Moderator


Joined: 19 Oct 2007
Posts: 2375
Location: Hilbert space

PostPosted: Tue Apr 30, 2013 4:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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