I would like to know the exact meaning and significance of Linux's Disk caching Mechanisms. In one of the articles I have read, page cache and dentry cache are two forms of them.
Could somebody explain to me these concepts?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Page cache, sometimes referred to as disk cache, is a transparent RAM buffer for access to and from on-disk files. In general any memory not allocated to running applications is used for page cache space. /proc/meminfo contains information about, among other things, page cache. Executing
cat /proc/meminfo | grep -iE "^(cached|dirty)" will display the size of the page cache and the volume of data marked "dirty", meaning file data that has been marked for writing to disk.
Dentry cache serves to improve performance access to the file system by storing entries representing the directory levels which comprise the representation of a path. Also contained in the dentry cache is an inode representing the object. Dentry cache resides opposite, or along side depending on perspective, the inode cache. The inode cache is comprised of two lists containing used and unused inodes respectively as well as a hash table of inodes in use. Every entry in the dentry cache contains an entry in the inode cache.