LWN.net Logo

Temporary files: RAM or disk?

Temporary files: RAM or disk?

Posted Jun 3, 2012 6:36 UTC (Sun) by quotemstr (subscriber, #45331)
In reply to: Temporary files: RAM or disk? by sorpigal
Parent article: Temporary files: RAM or disk?

> A new tmpfs-like FS that stores all files in RAM at first, stores them on disk if they grow large and also on disk if they remain for a long time.

You are aware that Linux, like all modern operating system kernels, has a unified caching subsystem, right? The VM subsystem _already does_ exactly what you want: it will page out tmpfs pages to backing storage (in this case, swap) just as it would page out file-backed pages to their backing stores; the exact identity of the backing store doesn't make a difference. The distinction between bytes in memory and bytes on disk isn't nearly as clear-cut as you think.


(Log in to post comments)

Temporary files: RAM or disk?

Posted Jun 4, 2012 5:08 UTC (Mon) by raven667 (subscriber, #5198) [Link]

One of the few reasonable statements in this discussion... Using the robust features of the kernel to implement the most sensible policy, who would have thought.

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