Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

C.5. Glock Holder

表 C.5 “Glock holder 标签” 演示了不同 glock holder 标签的含义。

表 C.5. Glock holder 标签

aAsync不等待 glock 结果(稍后会得到结果)
c没有缓存取消锁定时立即降级 DLM 锁定
E准确必须有 exact 锁定模式
tTryA "try" lock
TTry 1CBA "try" lock that sends a callback
最重要的拥有者标签之前提到的是 H(拥有者)和 W(等待),因为是将它们分别设定在已分配锁定请求和已排队锁定请求中。该列表中拥有者的顺序分厂重要。如果有任何已分配拥有者,他们总是位于队列的前端,后面跟着的是已排队拥有者。
The glock subsystem supports two kinds of "try" lock. These are useful both because they allow the taking of locks out of the normal order (with suitable back-off and retry) and because they can be used to help avoid resources in use by other nodes. The normal t (try) lock is basically just what its name indicates; it is a "try" lock that does not do anything special. The T (try 1CB) lock, on the other hand, is identical to the t lock except that the DLM will send a single callback to current incompatible lock holders. One use of the T (try 1CB) lock is with the iopen locks, which are used to arbitrate among the nodes when an inode's i_nlink count is zero, and determine which of the nodes will be responsible for deallocating the inode. The iopen glock is normally held in the shared state, but when the i_nlink count becomes zero and ->delete_inode() is called, it will request an exclusive lock with T (try 1CB) set. It will continue to deallocate the inode if the lock is granted. If the lock is not granted it will result in the node(s) which were preventing the grant of the lock marking their glock(s) with the D (demote) flag, which is checked at ->drop_inode() time in order to ensure that the deallocation is not forgotten.
This means that inodes that have zero link count but are still open will be deallocated by the node on which the final close() occurs. Also, at the same time as the inode's link count is decremented to zero the inode is marked as being in the special state of having zero link count but still in use in the resource group bitmap. This functions like the ext3 file system3's orphan list in that it allows any subsequent reader of the bitmap to know that there is potentially space that might be reclaimed, and to attempt to reclaim it.