LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: tomcat.xin

终于成功编译了内核,但是怎么看性能的提高的?

[复制链接]
发表于 2010-1-13 22:22:27 | 显示全部楼层
不可能用到的驱动就一定要删的

不过那个休眠,cpu变频的,CPU支持还是要开的


Post by dacheng;2064021
怎么使用-O2啊,真没注意可以这样


去了 第一个大项里面的optimize for size就是用-O2了

不过传说中Os因为体积小,有时比 O2的性能更好。
回复 支持 反对

使用道具 举报

发表于 2010-1-13 22:35:14 | 显示全部楼层
据说在cpu的ccache比较小的情况下-Os可能会比-O2效果好,我还是喜欢-O2,

性能吗,有提升,

gentoo的stable分支编译内核和系统内所有的包以后和freebsd7.2release编译内核和userland之后的速度基本上一样,同样的计算用debian stable就要慢很多,时间增加了25%左右吧,

同样的硬件,我自己测的,

但是只限于我测试的计算程序,其他情况就不好说了,

至于变频吗,我是台式机,没必要,

挂起那东西从来没用过,也去掉了。
回复 支持 反对

使用道具 举报

发表于 2010-1-14 18:22:20 | 显示全部楼层
Post by tomcat.xin;2063681
在失败了n次之后,终于成功编译了内核,但是怎么才能知道自己编译的内核对性能有多少提高呢?谢谢


You can verify results by running various benchmarking software such as http://www.phoronix-test-suite.com/

It is quit professional and widely accepted in Linux community.

Alternatively, I run SCIMARK2 and compare results.

Sorry, I am on trip to USA.  Computers here have no Chinese Input.
回复 支持 反对

使用道具 举报

发表于 2010-1-14 18:23:49 | 显示全部楼层
Post by fender010;2063944
我编译内核时主要有下面几个内容:

设定cpu,

不使用optimize for size而是使用-O2,

删除多余网络协议,删除多余的调度器,删除挂起以及cpu降频,

删除调试信息,删除多余文件系统,

删除多余的驱动(ATA驱动,现在都用SCSI了;USB的键盘、鼠标、操作杆、手写板之类的;多余的声卡、网卡、光驱)。


Well, you can change it to -O3 by editing the Makefile in the kernel source tree.

This is what I usually do.
回复 支持 反对

使用道具 举报

发表于 2010-1-14 18:37:14 | 显示全部楼层
Post by d00m3d;2064209
Well, you can change it to -O3 by editing the Makefile in the kernel source tree.

This is what I usually do.


我胆小,只敢用O2,

担心优化过度啊。
回复 支持 反对

使用道具 举报

发表于 2010-1-14 18:40:01 | 显示全部楼层
Don't worry, the kernel is very robust and you can always switch back to the old kernel, right?

Indeed, if you are already experienced with Gentoo and get used to compiling things, how come you are scared?

Give it a shot!
回复 支持 反对

使用道具 举报

发表于 2010-1-14 18:50:18 | 显示全部楼层
gentoo的优化指南里面提到过O2和O3的问题,

根据那个文档,O3在gcc的3.x是比较可靠的,到了gcc的4.x就不是那么可靠了,所以我就没有打算尝试,

而且编辑内核的Makefile这个事我感觉还是有点危险,还真没做过,我对make的语法了解很少,只能看懂简单的Makefile,

而且我担心会不会导致内核的misfunction,就是担心内核能启动能运行,但是某些时候有一些奇怪的行为,

不过既然你总这么干,到不妨尝试尝试一下,哈哈。
回复 支持 反对

使用道具 举报

发表于 2010-1-14 19:00:53 | 显示全部楼层
That one is rather old and it refers to the optimization flags in building the system in general, so it should be more conservative to ensure system stability.

If you are compiling the kernel yourself, not using the genkernel approach that the USE flags are taken into account but using regular Linux standard method, than it should have no problems.

To make changes in the Makefile is rather easy because there are only 3 "-O2" entries in the Makefile.  Simply use your favourite text editor to replace all of them to -O3 will do the job.

If you replace them one-by-one, you can understand what the purposes of the codes are.  They are simple.

Of course, you should not choose "Optimize for size", otherwise, -Os will become active.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-1-14 19:15:32 | 显示全部楼层
Post by d00m3d;2064208
You can verify results by running various benchmarking software such as http://www.phoronix-test-suite.com/

It is quit professional and widely accepted in Linux community.

Alternatively, I run SCIMARK2 and compare results.

Sorry, I am on trip to USA.  Computers here have no Chinese Input.


Thank you, english is ok.
回复 支持 反对

使用道具 举报

发表于 2010-1-14 19:17:04 | 显示全部楼层
Post by fender010;2064231
gentoo的优化指南里面提到过O2和O3的问题,

根据那个文档,O3在gcc的3.x是比较可靠的,到了gcc的4.x就不是那么可靠了,所以我就没有打算尝试,

而且编辑内核的Makefile这个事我感觉还是有点危险,还真没做过,我对make的语法了解很少,只能看懂简单的Makefile,

而且我担心会不会导致内核的misfunction,就是担心内核能启动能运行,但是某些时候有一些奇怪的行为,

不过既然你总这么干,到不妨尝试尝试一下,哈哈。

By the way, I am rather aggressive.  I built my own kernel 2.6.32.3 with a developer snapshot (meaning buggy and unstable) version of gcc-4.5-20100107 with the -O3 flag.  My system still runs fine, also no problems with the latest Nvidia driver.
回复 支持 反对

使用道具 举报

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

本版积分规则

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