如果你用free -m 这个命令,输出:
点击(此处)折叠或打开
- [firo@fedora ws]$ free -m
- total used free shared buffers cached
- Mem: 5639 3457 2182 0 238 1680
- -/+ buffers/cache: 1537 4102
- Swap: 1951 0 1951
cached则是Page cache,存储文件的实际内容。
== Understand ==
要了解Buffer cache的运行机理,要看看Block IO layer。
== Lateral exploration ==
==Apply ==
内核使用struct address_space 这个结构作为page cache的实体。
连接了内存中pages 和 设备或fs上的对象文件。
内核使用struct buffer_head