Minor disagreement about the following: "Everyone must worry about whether their files need to survive a reboot" I believe there was never such expectation of /tmp. On many systems it's being wiped periodically or even when the user's last session ends. The example app(s) that use /tmp for drafts need(s) to be fixed.
Tmpfs considered harmful
51–60 of 85 posts
Re: Tmpfs considered harmful
#52IO bound becomes CPU bound so you're getting as good speed as you can get.
Re: Tmpfs considered harmful
#53Earlier quoted context omitted.
This is exactly the point of the posting. Every program has to be examined for this problem, and it forces a complex decision about the storage hierarchy onto every programmer.
That's like saying "RAM considered harmful", because every time a developer has to think "do I just store this in memory, or do I sync it to disk" "it forces a complex decision about the storage hierarchy": /tmp is simply RAM that has the API of a file; it used to be implemented using a horrible kludge with files on disk that were periodically deleted, but with tmpfs the dream became a reality.
Re: Tmpfs considered harmful
#54One of the hardest parts of writing a compiler is register allocation. Not quite. There are many much more difficult problems in a competitive optimizing compiler before hitting that step. You can get reasonable results from even a linear scan allocator, which is simple.
Current x86 implementations do a good job of being fast even when registers spill.
I've seen dual-issue Power cores (32ish registers) that only have 16k of 4-way dcache, which means register spills can easily kill performance.
Re: Tmpfs considered harmful
#55As an amusing example, the SHM (shared memory) system in linux is actually implemented on top of tmpfs (/dev/shm is a tmpfs mount).
Other uses include CoW shadow mounting (when unioned to an immutable filesystem).
That said, the point that /tmp should not be a tmpfs mount is actually a decent one, just because we're used to the idea that /tmp is neither space-constrained (it's scratch space) nor extra performant.
Re: Tmpfs considered harmful
#56Re: Tmpfs considered harmful
#57Re: Tmpfs considered harmful
#58"Everyone must now be careful never to store a file in /tmp that might grow large" If you're going to trash my /tmp with gigantic files please don't. Really "it’s better to fix the filesystem to make it faster" Yes, let's spend adding more complexity to the file system to work out every /tmp abuser out there. But his original point was avoiding adding complexity in the first place So basically, he contradicts himself…
Re: Tmpfs considered harmful
#59Why on earth would anybody ever use tmpfs for /tmp? If I'm writing a program that deals with a big file, and I want to temporarily write something to the filesystem, it is because I dont want it in memory. Why would you ever write to /tmp for any reason other than to get something out of ram for a while?
Re: Tmpfs considered harmful
#60Why on earth would anybody ever use tmpfs for /tmp? If I'm writing a program that deals with a big file, and I want to temporarily write something to the filesystem, it is because I dont want it in memory. Why would you ever write to /tmp for any reason other than to get something out of ram for a while?
Having it sit in RAM is great, because I get the speed without subjecting my disk to unnecessary writes - for certain operations, this can be a huge bonus.