View Single Post
Old 29th May 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

The posts generally applicable.

My advice:

Set CPUTYPE as harisman suggested, it makes sense to do so (for example I havn't used any thing but i685 and em64t chips in a long time, never seen an Intel 80386 either)

Using SCHED_ULE might be worth while as Oliver_H posted. I've personally never had a problem with any of the schedulers I've built kernels off, but I don't run high load servers !

Do not mess with CFLAGS or CXXFLAGS unless you know what you are doing.

Do not mess with CFLAGS unless you know what you are doing and are a C Programmer familiar with the available options to gcc.

Do not not mess with CXXFLAGS unless you know what you are doing and are a C++ Programmer familiar with the available options to g++.

Do not touch CFLAGS or CXXFLAGS for building world or kernel unless you are a FreeBSD hacker and know what you are doing.

Always read the compiler documentation before setting CFLAGS/CXXFLAGS outside your own programs, and even then read it if you don't know what is happening.


(Might seem rude but the above comments might make life easier in the long run.)


The cross reference to optimizing kernel builds should be taken with a grain of salt as far as some parts go. Same for the kernel related options imho -> make sure of things before screwing around with non-important stuff, less headaches then hunt & pecking options.


Locate bottlenecks before trying to optimize them.

Quote:
Originally Posted by the article
With any performance tuning, it is important to monitor your system after you make your changes. Did you go overboard, or underestimate what you would need? Always check and adjust accordingly. The numbers here might not be the exact ones that you need!

Unless you hit a spot that can benefit from optimization, you probably shouldn't change things from defaults unless you know what your changing or are willing to play with it until you either break it, fix it, or perfect it.


PS:

I generally build my own programs with CFLAGS set to one of these values in my makefiles:

Code:
# normal build
CFLAGS= -Wall -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion \
        -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes \
        -Wmissing-declarations -Wredundant-decls -Winline -Wnested-externs\
        -std=c99 -march=i686

# for debugging builds append to CFLAGS
 -ggdb  # or -g3

# optimized builds with options added after clfags, used for testing for problems that may occur in the code when optimized
OFLAGS= -fforce-mem -fforce-addr -finline-functions -fstrength-reduce \
        -floop-optimize -O3
These are my standard settings, each was chosen with consideration behind the them and I usually settle on warnings only while writing things, saving the rest for playing around.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote