Kernel —— Page cache and Buffer cache

2240阅读 0评论2013-07-13 firocu
分类:LINUX

== Structure ==
如果你用free -m 这个命令,输出:

点击(此处)折叠或打开

  1. [firo@fedora ws]$ free -m
  2. total used free shared buffers cached
  3. Mem: 5639 3457 2182 0 238 1680
  4. -/+ buffers/cache: 1537 4102
  5. Swap: 1951 0 1951
这里buffers指的是Buffer cache, 存储文件的metadata,inode之类。
cached则是Page cache,存储文件的实际内容。

== Understand ==
要了解Buffer cache的运行机理,要看看Block IO layer。

== Lateral exploration ==

==Apply ==
内核使用struct address_space 这个结构作为page cache的实体。
连接了内存中pages 和 设备或fs上的对象文件。
内核使用struct buffer_head




上一篇:基于core dump的用户空间调试
下一篇:Kernel —— Block device driver