2010年3月12日星期五

Comparison of Hard Link and Symbolic Link

Comparison of Hard Link and Symbolic Link

ItemHard LinkSymbolic Link
Name resolution Faster. A hard link contains a direct reference to the object.Slower. A symbolic link contains a path name to the object, which must be resolved to find the object.
Object existenceRequired. An object must exist in order to create a hard link to it. Optional. A symbolic link can be created when the object it refers to does not exist.
Object deletion Restricted. All hard links to an object must be unlinked (removed) to delete the object.Unrestricted. An object can be deleted even if there are symbolic links referring to it.
Dynamic objects (attributes change)Slower. Many of the attributes of an object are stored in each hard link. Changes to a dynamic object, therefore, are slower as the number of hard links to the object increases. Faster. Changes to a dynamic object are not affected by symbolic links.
Static objects (attributes do not change) Faster. For a static object, name resolution is the primary performance concern. Name resolution is faster when hard links are used. Slower. Name resolution is slower when symbolic links are used.
ScopeRestricted. Hard links cannot cross file systems. Unrestricted. Symbolic links can cross file systems.

2010年3月7日星期日

LockMeter

最近在系统学习LDD3(以前都是临时抱佛脚),在第五章看到了关于LockMeter(http://oss.sgi.com/projects/lockmeter/)。LockMeter可以分析出不同Linux版本在SMP支持上的性能的差异,分析Lock
Hold/Wait Time。我很想在我的Kernel里面玩玩,但是看到LockMeter网站上支持的内核不够新(2.6.16
Latest),我的Kernel是2.6.32.3,或许Kernel已经加入了这个功能?于是我开始在我的2.6.32.3内核中找寻是否有相关的东西。在Document目录中发现了lockstat.txt,很像LockMeter,OK!menuconfig->Kernel
Hacking->Lock usage statistics,make bzImage/Update
grub.confg,一切妥当,boot新的内核,意外发生了:

Give up waiting for root device. Common problem:
- Boot args (cat /proc/cmdline)
- Check rootdelay = (did the system wait log enough?)
- Check root = (did the system wait for the right device)
- Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/dist/by-uuid/xxxxx doest not exist. Dropping to a shell!


奇怪,怎么就找不到硬盘了呢?我把rootdelay设置到了200都不OK!忙活了几个小时,不知道为何,思路有点乱,改天再研究!