【参加讨论】优化linux 内核:
删除没有的rpm 包:
首先要停止正在运行的进程
cd /etc/rc.d/init.d
./sendmail stop
./apmd stop
./kudzu stop
rpm -e --nodeps sendmail kudzu nfs-utils
编辑文件 /usr/src/linux/include/linux/tasks.h
编辑第十四行 (vi +14 ) :
nr_tasks 5120 ---> 3072
min_tasks_left_for_root 16 ---> 24
编辑文件 /usr/src/linux/makefile
编辑第十八行 (vi +18 ) :
hostcc =gcc
--->
hostcc =egcs
编辑第二十五行 (vi +25 ) :
cc =$(cross_compile)gcc -d__kernel__ -i$(hpath)
--->
cc =$(cross_compile)egcs -d__kernel__ -i$(hpath)
编辑第九十行 (vi +90 ) :
cflags = -wall -wstrict-prototypes -o2 -fomit-frame-pointer
--->
cflags = -wall -wstrict-prototypes -o9 -funroll-loops -ffast-math -malign-double -mcpu=
pentiumpro -march=pentiumpro -fomit-frame-pointer -fno-exceptions
编辑第十九行 (vi +19 ) :
hostcflags =-wall -wstrict-prototypes -o2 -fomit-frame-pointer
--->
hostcflags =-wall -wstrict-prototypes -o9 -funroll-loops -ffast-math -malign-double -mcpu=
pentiumpro -march=pentiumpro -fomit-frame-pointer -fno-exceptions
设置内核:
make xconfig
具体可自己根据系统来设置
在 /usr/src/linux/ 目录下
make dep
make clean
make bzlilo
make modules
make modules_install