To clarify, this is about using tmpfs for /tmp being harmful. Specialized use of tmpfs in other situations is fine.

Fedora (beginning with 18) has changed /tmp so it is now a separate tmpfs partition. I’ve asked FESCO to consider reverting this.

tmpfs is usually a bad idea.

Computer storage is hierarchical for performance reasons: CPU registers are ultra-fast but very few in number. Cache is faster than main memory. Disk drives are slow, but huge and persistent.

These are unavoidable facts, caused by the design of electronics. Every time we move down a step in this hierarchy, it introduces complexity. One of the hardest parts of writing a compiler is register allocation. Complex NP-complete algorithms have to be written, and only the most expert programmers and theorists tackle this. (For JIT allocation it’s still very much an open research area). Countless thousands of hours have been spent by kernel developers to optimize cache performance. When we have to decide what to keep in memory and what to spill to disk, complex paging algorithms are designed and tuned ad nauseam.

tmpfs introduces an entirely artificial and unnecessary step that all programmers and users have to worry about. It’s limited to at most the available memory + swap space (although by default to half of RAM). Swap is usually stored on a separate partition that cannot expand, so you can run out of swap (and hence /tmp), still have plenty of free disk space, and your machine will crash.

Everyone must now be careful never to store a file in /tmp that might grow large, nor too many files at the same time. Every last little utility must be checked, including ones that aren’t part of your distro. Every user must be “re-educated” not to use /tmp for temporary files.

Everyone must worry about whether their files need to survive a reboot. (For example the default mutt configuration stores newly drafted emails in /tmp, so you’d better hope your machine doesn’t suffer a power failure while you’re writing. Or that you don’t have to compose an email larger than half available memory.)

All of this is quite unnecessary. We already have a memory-backed storage system that transparently spills to the filesystem. It’s called … the filesystem.

The case for performance has not been made either, but even if we assume that tmpfs is vastly better than the filesystem, it’s better to fix the filesystem to make it faster than to spend any more time on tmpfs. Fixes to the filesystem benefit everyone.

It’s good that Debian reverted this change, and Fedora should too.