QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5249|回复: 44

编译内核的时候可以用哪些cflag

[复制链接]
发表于 2003-6-29 16:11:39 | 显示全部楼层 |阅读模式
在makefile里看到好像只用了一个-o2,我该成了-O3 -pipe -fomit-frame-pointer(参照一些文章)
结果重新编好后内核只执行一个功能:重起,是编内核的时候不能加其他flag,还是哪个flag不该设?
发表于 2003-6-30 00:04:02 | 显示全部楼层
-O2 is enough
-march can optimize some if u use p4 , p3 or amd cpu instead of ppro.
回复

使用道具 举报

 楼主| 发表于 2003-6-30 15:20:09 | 显示全部楼层
好像在arch/i386/makefile中根据你的cpu已经自动加上了 -march和-mcpu
我后来又试了试,把-o2变成-o3不能成功,但总得有原因吧,o3比o2多了-finline_function和??(忘了),不知道是哪个引起的问题,但对于一般程序o3是没有问题的,可能kernel比较特殊一些
回复

使用道具 举报

发表于 2003-6-30 22:05:07 | 显示全部楼层
inline is from -O

default mcpu is i686, u can change to p4 or p3
回复

使用道具 举报

 楼主| 发表于 2003-7-1 23:32:29 | 显示全部楼层
我发现加上
-fomit-frame-pointer -falign-functions=4 -fprefetch-loop-arrays
(-o2不变)
系统速度有提高,至少gnome的相应速度有明显提升
是参照freehacker.com的gentoo unsafe flag for pIII,没加-fforce-addr,因为加了编不出来
想能不能多一些人试试,是不是普遍有效
回复

使用道具 举报

发表于 2003-7-2 02:24:09 | 显示全部楼层
u feeling about gnome maybe inaccurate. we need a benchmark to test the improvement
回复

使用道具 举报

发表于 2003-7-2 02:26:48 | 显示全部楼层
u may have a summary here when u finish. and welcome more people to test. but we need a quantitive evaluation.
回复

使用道具 举报

 楼主| 发表于 2003-7-2 15:04:49 | 显示全部楼层
你推荐一个测试工具吧
回复

使用道具 举报

发表于 2003-7-2 21:18:15 | 显示全部楼层
http://kernelbench.nl.linux.org/links.html

hbench-os and lmbench is useful for system primitives. i think these two are enough.
io benchmark can test the fs cache...
回复

使用道具 举报

发表于 2003-7-2 21:27:13 | 显示全部楼层
dragonfly,当你给别人推荐网址的时候,是否可以把比较好的网址copy到那个有很多网址的帖子上呢?     
回复

使用道具 举报

发表于 2003-7-2 22:00:32 | 显示全部楼层
o, sorry, i will do it now.
回复

使用道具 举报

 楼主| 发表于 2003-7-3 23:06:18 | 显示全部楼层
lmbench
不会用啊,他的说明也不全
回复

使用道具 举报

发表于 2003-7-3 23:32:03 | 显示全部楼层
o, i think readme is enough.
can u try hbench-os then?
回复

使用道具 举报

 楼主| 发表于 2003-7-6 21:26:06 | 显示全部楼层
hbenchos初步测了一下
kernel编译时加入-fomit-frame-pointer -falign-functions=4 -fprefetch-loop-arrays  相比不加时系统性能:

mem_write有8.3%加速
mem_read   2.7%加速
mem_copy_unrolled_unaligned 14.8%加速
mem_copy_unrolled_aligned 15%加速
bw_pipe 5.3%加速
文件系统微量加速
hbenchos的分析结果的程序总是抱错,所以只是比较测试生成的原始文件,
如果你决的有必要,我再试试,不过测试时间太长了……
回复

使用道具 举报

发表于 2003-7-6 21:52:22 | 显示全部楼层
can u post the procedure how u use the hbench-os here?

and i do not know why it can speed up the mem op. need to check these options.

do u change the march? O2/O3? how about these?

thx a lot.   
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-19 18:43 , Processed in 0.046415 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表