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.