Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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")?
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
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.
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:
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.