LWN.net Logo

Ever further off topic :)

Ever further off topic :)

Posted Apr 22, 2009 9:20 UTC (Wed) by michaeljt (subscriber, #39183)
In reply to: Another Linux capabilities hole found by i3839
Parent article: Another Linux capabilities hole found

Does Linux actually cache file data, or only block data? I would have thought that user space filesystem latency could be reduced quite a bit by clever caching - the kernel caches data from file reads (with a bit of read-ahead), and writes to files, and sends them to the user space filesystem as a package. If the filesystem has an underlying block device, this could be done shortly before the block device cache is due to be flushed.


(Log in to post comments)

Ever further off topic :)

Posted Apr 22, 2009 22:57 UTC (Wed) by nix (subscriber, #2304) [Link]

Of course Linux caches file data: in fact it won't work without it.
Absolutely everything that gets put in a page in memory (all file data,
anonymous mmaped pages, you name it) has to pass through the page cache
first. Executables *run* from the page cache: their text pages reside
nowhere else.

There *is* a cache of disk blocks (the buffer cache), but these days it's
used pretty much entirely for metadata (as this doesn't necessarily have a
page in memory devoted to it).

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds