本文简要介绍一下LevelDB中LRUCache的实现。
C++11中的atomic
第1节和第2节简单介绍g++ (GCC) 4.8.5
的atomic实现。
Wandering Tree
There is a whitepaper on the UBIFS page, and LWN wrote about it in the LogFS article.
The on-flash tree looks much like the structure used by ext2. There are some differences in how it is managed, however. The log structure of the filesystem implies that blocks cannot be rewritten in place; any time a block is changed it must be moved and written to a new location. If there are pointers to the moved block (think about the usual indirect blocks used to store the layout of larger files), the blocks containing the pointers must also be changed, and thus moved. That, in turn, will require changes at the next level up in the tree. Thus changes at the bottom of the tree will propagate upward all the way to the root. This is the “wandering tree” algorithm. One of the advantages is that the old filesystem structure remains valid until the root is rewritten - a crash could cause the loss of the last operation, but it will leave previous data and the structure of the filesystem intact.
Actually managing the entire directory tree as a wandering tree would be expensive; beyond that, files with multiple hard links break the tree structure and make wandering trees much harder to implement. So the actual tree implemented by LogFS just has two levels. There is an “inode file” containing the inode structures for every file and directory existing within the filesystem; each inode then points to the associated blocks holding the file’s data. Directory entries contain a simple integer index giving the inode offset within the inode file. So changes to an inode only require writing the inode itself and the inode file; the rest of the directory structure need not be touched.
使用block_dump观察block io
Linux提供了一种机制,可以用来dump出block io详情,即/proc/sys/vm/block_dump。
Linux fio
fio是平时常用的工具之一,然而它有很多参数用于定制不同的压力模式,输出也包含很多信息,之前没有仔细研究。本文搞清楚一些常用参数所定制的行为,并且详细解读一下输出的信息。
libnetfilter_queue的使用
jemalloc的heap profiling
RocksDB中的LRUCache
本文简要介绍一下RocksDB中LRUCache的实现。
搭建vim的go开发环境
本文记录基于vim搭建go开发环境的过程。
tcpdump的使用
本文介绍抓包工具tcpdump在linux下的使用。Linux的tcpdump manual中包含许多选项以及复杂的filter表达式,我们工作中往往用不到这么多的选项和太复杂的filter。所以本文介绍一些常用的选项和filter规则,尽可能的通过一些例子来说明。