Mailinglist Archive: opensuse (3644 mails)

< Previous Next >
Re: [SLE] kernel optimization
  • From: John Lamb <J.D.Lamb@xxxxxxxxxxxxxx>
  • Date: Tue, 12 Mar 2002 07:45:03 +0000
  • Message-id: <3C8DB1FF.97A56E97@xxxxxxxxxxxxxx>
Dorin Titiriga wrote:

I have read in linuxJournal that I can be able to optimize my kernel
using this parameters:

CFLAGS='-o9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro
-march=pentiumpro -fomit-frame-pointer -fno-exceptions'

I have some problems

1. My cpu is a Atlon at 900 mhz, not a pentium. With what to replace
pentiumpro ?
2. I have compiled at home the kernel ignoring -mcpu and -march, the
kernel was compiled fine, with no errors, but after i have installed, it
does nothing. It is broken !, so how to optimize my kernel ?

Some of these flags look distinctly dangerous. The -o9 should be -O9 and
is pretty well guaranteed to cause problems (I have found that even -O3
can cause problems with very simple code I've written). The
-malign-double flag will speed things up a fraction but at the risk of
creating incompatibilities. For example, I once tried compiling gimp
with this flag and found that it crashed when using jpeg files.

The -mcpu=pentiumpro and -march=pentiumpro mean generate code optimised
for a pentium pro and generate code that will only run on pentium pro or
higher (and therefore even more optimised). I don't think there's any
advantage in using both and they may even conflict. For an Athlon, the
flag you want is -march=k6.

If you configure your own kernel with xconfig (and probably menuconfig
too), you get the option of specifying what kind of architecture you
have and the configuration automatically gives you sensible
optimisations. It is unwise to try to do more unless you really know
what you are doing.

JDL

< Previous Next >
Follow Ups
References