LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   i686 optimized kernel? (https://www.linuxquestions.org/questions/linux-kernel-70/i686-optimized-kernel-595119/)

e.v.o 10-27-2007 07:09 PM

i686 optimized kernel?
 
HI folks,
as you may know there are several options for gcc to optimize the build. but normally i would write
"./configure CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"".
when i'm compiling the kernel i only write "make menuconfig" so i asked myself where the option is set or if there is a option i can set?
when looking at the options in the config, you can select your specific type of processor. is possible that this option is used?
and is it possible to compile the kernel with icc?

hope you could help me ;)

acid_kewpie 10-28-2007 11:49 AM

it's one of the hundreds of menu options. just take a closer look. it's at the top of one of the first few top level menus.

e.v.o 10-28-2007 06:21 PM

thanks, i already knew that, but the question is if there is more room for optimization?
when i make the image is this option used to "configure" (like "./configure --$foo")?

syg00 10-28-2007 07:28 PM

I've never been enamoured with trying to screw with kernel optimization - the devs optimize the hell out of it as it is.
Better them than me - that being said, have a look at the Makefile; you should be able to pass C{XX}FLAGS in

acid_kewpie 10-29-2007 01:49 AM

why would a single ./confgure option provide more optimization than a ui menu option? it's the same thing...

and developers *don't* optimize things that much, you can optimize for an amd kernel for example, something very very few distro vendors do, they just hit for i386 or i686.

syg00 10-29-2007 02:32 AM

I was talking about the kernel devs - go look at the memory management code. Plenty of inline assembler and optimization for cache-line width.

acid_kewpie 10-29-2007 02:37 AM

well yes, but that's not what's being questioned here...

jayjwa 10-29-2007 03:01 AM

These are set in the Makefile (around line 198) for my 2.6.23.1, I'd assume you can monkey with them if you really want to, but I'd tend to favor the wizdom of the kernel developers as per optimization. It looks like they are already doing some:

HOSTCC = gcc
HOSTCXX = g++
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
HOSTCXXFLAGS = -O2

Try also make CFLAGS='whatever' (or possibly HOSTCFLAGS='whatever'), which may work, as I know make CC='whatever' is respected. I frequently use "make CC='distcc gcc ' " to speed things up for my slower P2 system.

As for ICC, as far as I know...Nope.

e.v.o 10-29-2007 05:54 AM

omg! there it is ;)
thank you! i will try it and make some benchmarking the next days...

sundialsvcs 10-29-2007 05:44 PM

From time to time, the Kernel Gods discuss this issue, and they seem to consistently choose "mid-range" optimization levels on just about every processor. And the KGs do nothing by accident.

Generally speaking, when you are dealing with kernel-level programming, you want the generated object-code to efficiently implement what the source-code is suggesting, but you also want it to fairly closely follow it. Optimization can be carried too far, and in some releases of gcc it can become downright wrong.

With any high-performance programming, such as an OS kernel certainly, the most important consideration is find a good algorithm. If there's a performance problem somewhere in the code, as revealed and isolated by careful measurements, the KGs will look for an algorithm improvement ... not a compiler tweak.

e.v.o 10-30-2007 10:44 AM

but a "good" compiler can analyse the algo and can apply some optimization to it. so it's up to the code and also the compiler...


All times are GMT -5. The time now is 01:42 AM.