Re: /tmp in swap space

Richard Gooch (Richard.Gooch@atnf.CSIRO.AU)
Sun, 24 May 1998 10:57:57 +1000

Larry McVoy writes:
> On the other hand, TMPFS is somewhat useful for large file I/O, it will
> run at bcopy speeds. I'm hardpressed to think of a case where having
> high bandwidth for short lived files is a win - most of the files created
> in /tmp are temp files, and are usually a few KB to a few MB. For files
> that small, higher bamdwidth isn't going to gain you anything (and EXT2FS
> will approximate TMPFS for smaller files which fit in the cache).

Well, I can give you a real-world example. Because I haven't yet found
an OS which has useful mmapping semantics for /dev/zero (namely that I
can open /dev/zero and pass a FD to another process and both processes
can mmap() the FD and share data via the mmapped region), I end up
creating a tmpfile in /tmp for mmapping purposes. Under Linux, this is
at least 16 MBytes (because under 16 MBytes I can use ordinary SysV
SHM). This tmpfile doesn't need to be saved to disc (not when you have
gobs of RAM).
So here is a real case where large files with a moderate lifetime (at
least a few minutes) are created in /tmp.



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to