Chris's Wiki :: blog/unix/UnifiedBufferCache Commentshttps://utcc.utoronto.ca/~cks/space/blog/unix/UnifiedBufferCache?atomcommentsDWiki2019-02-15T16:31:36ZRecent comments in Chris's Wiki :: blog/unix/UnifiedBufferCache.By Alan on /blog/unix/UnifiedBufferCachetag:CSpace:blog/unix/UnifiedBufferCache:9305147cc4c26df865c8b71ac2df981686617559Alanhttps://twitter.com/sourcejedi<div class="wikitext"><p>The history of this in Linux is a bit difficult to track; it's old and confusing.</p>
<p>"In Linux 2.2 the page cache used the buffer cache to write back its data, needing an extra copy of the data and doubling memory requirements for some write loads, in Linux 2.4 dirty page cache pages are simply added in both the buffer and the page cache. The system does disk IO directly to and from the page cache page. That the buffer cache is still maintained separately for filesystem metadata and the caching of raw block devices. Note that the cache was already unified for reads in Linux 2.2, Linux 2.4 just completes the unification."</p>
<p><a href="https://www.usenix.org/legacy/event/usenix01/freenix01/full_papers/riel/riel_html/">https://www.usenix.org/legacy/event/usenix01/freenix01/full_papers/riel/riel_html/</a></p>
<p>This must be where the obsolete definitions of "buffers" come from. I.e. `man proc`: "Buffers %lu - Relatively temporary storage for raw disk blocks that shouldn't get tremendously large (20MB or so)", and `man free`: "Memory used by kernel buffers (Buffers in /proc/meminfo)".</p>
<p>"Kernel buffers" is a reasonable way to describe write buffers. But not the current system, where Buffers (the cache used when you read() / write() directly to a block device) is handled exactly as page cache.</p>
</div>2019-02-15T16:31:36Z