Re: /tmp in swap space

Jim Nance (
Sat, 23 May 1998 07:41:28 -0400

----- Forwarded message from Larry McVoy <> -----

: I recently saw that Solaris shares the drive space for swap and for the
: files in the /tmp directory (/tmp is mounted from the swap partition as
: filesystem type swapfs).
: Has anybody thought about this? Has this already been done for linux in
: some patch somewhere? Are there solid reasons not to do this? would a
: significant performance impact be unavoidable? Would it be difficult to
: use the ulimit settings for quota on the '/tmp-filesystem'?

The last time I looked at this closely was when I was writing lmbench,
in particular, the file system latency tests. TMPFS was a win over
UFS because small, short lived files are expensive to create in UFS -
the file system does a sync write to the disk to update the meta data.
The sync write limited file creates to about 35/sec (single threaded),
whereas TMPFS got ~1000/second.

----- End of Forwarded message from Larry McVoy <> -----

Just to back up what Larry said I recently was having some performance
problems under Solaris. I wrote a test program which sat in a loop and did:

write() /* 1 byte */

on a file. It turns out that Solaris can only do about 100 loops/second
because it has to do disk i/o every time it creates the file. If I ran
the test program in /tmp, which was a ramdisk, then I could do several
thousand loops/second (I think 24K loops/sec, but I dont exactly remember).
When I tried this under Linux I found that ext2 performance was comprable
to Solaris ramdisk performance. This is because Linux does not have to
hit the disk each time it creates a file.

We talked to Sun about this. The response was that their file system people
were afraid that doing asynchronos metadata updates could lead to file
system corruption if the system was shut down uncleanly. I can remeber
several debates on this list about whether that statement is true or not,
but I don't know enough about file systesm to comment.

FWIW, both SunOS and Digital Unix also seem to operate the way that Solaris
does. Its interesting to observe that my old Sparc-5 clone creates files
at the same rate as my 600MHz AlphaStation, at least when running the vendor
supplied operating systems.


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