LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 10-27-2007, 07:09 PM   #1
e.v.o
LQ Newbie
 
Registered: Mar 2007
Location: Germany
Distribution: Slackware 12.0
Posts: 18

Rep: Reputation: 0
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
 
Old 10-28-2007, 11:49 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 10-28-2007, 06:21 PM   #3
e.v.o
LQ Newbie
 
Registered: Mar 2007
Location: Germany
Distribution: Slackware 12.0
Posts: 18

Original Poster
Rep: Reputation: 0
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")?
 
Old 10-28-2007, 07:28 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
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
 
Old 10-29-2007, 01:49 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 10-29-2007, 02:32 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
I was talking about the kernel devs - go look at the memory management code. Plenty of inline assembler and optimization for cache-line width.
 
Old 10-29-2007, 02:37 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well yes, but that's not what's being questioned here...
 
Old 10-29-2007, 03:01 AM   #8
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 746

Rep: Reputation: 234Reputation: 234Reputation: 234
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.
 
Old 10-29-2007, 05:54 AM   #9
e.v.o
LQ Newbie
 
Registered: Mar 2007
Location: Germany
Distribution: Slackware 12.0
Posts: 18

Original Poster
Rep: Reputation: 0
omg! there it is
thank you! i will try it and make some benchmarking the next days...
 
Old 10-29-2007, 05:44 PM   #10
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,609
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
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.
 
Old 10-30-2007, 10:44 AM   #11
e.v.o
LQ Newbie
 
Registered: Mar 2007
Location: Germany
Distribution: Slackware 12.0
Posts: 18

Original Poster
Rep: Reputation: 0
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...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ArchLinux is optimized for i686... pppaaarrrkkk Linux - Newbie 3 06-30-2005 02:09 PM
i686 optimized distro wanted flying-tuxman Debian 23 06-11-2005 08:45 AM
What makes it i686 optimized ? kriton12 Slackware 15 03-21-2005 04:07 AM
Kernel optimized for space RFLAGG Linux - Software 2 08-26-2004 02:53 AM
Fedora or other distro optimized for i686 or athlon-xp Apollo77 Linux - Distributions 2 05-25-2004 03:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration