Storing Blocks in the Page Cache
In old versions of the Linux kernel, there were two different main disk caches: the page cache, which stored whole pages of disk data resulting from accesses to the contents of the disk files, and the buffer cache , which was used to keep in memory the contents of the blocks accessed by the VFS to manage the disk-based filesystems.
Starting from stable version 2.4.10, the buffer cache does not really exist anymore. In fact, for reasons of efficiency, block buffers are no longer allocated individually; instead, they are stored in dedicated pages called “buffer pages ,” which are kept in the page cache.
Formally, a buffer page is a page of data associated with additional descriptors called “buffer heads ,” whose main purpose is to quickly locate the disk address of each individual block in the page. In fact, the chunks of data stored in a page belonging to the page cache are not necessarily adjacent on disk.
Block Buffers and Buffer Heads
Each block buffer has a buffer head
descriptor of type
This descriptor contains all the information needed by the kernel to
know how to handle the block; thus, before operating on each block,
the kernel checks its buffer head. The fields of a buffer head are
listed in Table
Table 15-4. The fields of a buffer head