Fw: Kernel Optimization

=?Windows-1252?Q?Rolando_L=F3pez?= (ralch@infovia.com.gt)
Mon, 12 Jul 1999 11:39:03 -0600


Are the lines below the best option to compile a 2.2.x kernel with egcs running
on a Pentium II?

-O6 -mpentiumpro -march=pentiumpro -malign-function=2
-malign-jumps=2 -malign-loops=2 -fomit-frame-pointer
-fstrength-reduce

Background

We have recently installed RedHat 6 on a PowerEdge 4300, PII 350Mhz with 256MB
of RAM. RedHat 6 determines the type of processor and installs the compiled
kernel accordingly. This kernel has been compiled with the "best" performance
optimizations depending on the hardware.

As a non-scientific measure of this kernel performance, at boot time, the
RAID 5 routines reached 850MB/s. This measure can be seen after booting in /var/log/messages

After that, we updated the kernel to version 2.2.7, but we obtained only 835MB/s
in the same measure.

These are the options used and the compiler version:

Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

We modify /usr/src/linux/Makefile like this:

HOSTCC = egcs
HOSTCFLAGS = -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer
CC = $(CROSS_COMPILE)egcs -D__KERNEL__ -I$(HPATH)

And /usr/src/linux/arch/i386 as the following:

CFLAGS_NSR := -fstrength-reduce
ifdef CONFIG_M686
CFLAGS := $(CFLAGS) -mpentiumpro -march=pentiumpro -malign-loops=2
-malign-jumps=2 -malign-functions=2 -DCPU=686
endif

The machine is used as transparent proxy server with squid 2.2.stable3 (compiled
with the same options)

We didn't have any trouble at compilation time nor we had stability problems
with egcs. Squid is reaching the 50% Hit Ratio but is using too much CPU time,
around 27% with 17% of system time and 10% of user time.

I understand that optimizing the kernel is not what best improves performance, but
there is nothing else we could do to the PowerEdge 4300 with our current budget, and
given that the options used to compile RedHat 6 achieved a better throughput
(850 versus 835) and that squid is using too much system time,
maybe there should be something that could be done to recompile the
kernel and squid and obtain some kind of improvement.

I'll appreciate your advice on this.

Regards,

Rolando

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/