Re: /tmp in swap space

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Sat, 23 May 1998 22:09:38 +0100


Larry McVoy wrote:
> ... (and EXT2FS will approximate TMPFS for smaller files which fit in
> the cache).

If I do the following:

open ("/tmp/file", O_CREAT|O_TRUNC|O_WR)
write (....) /* Small enough to fit in cache. */
close ()
/* Do some work, file still stays in cache. */
unlink ("/tmp/file")

Is ext2 clever enough to avoid writing data blocks for the deleted file
to the disk? This has always struck me as the reason why a Linux tmpfs
would be useful.

I could ask is ext2 clever enough to avoid writing _anything_ in this
case, but I think that's clearly asking too much.

Would a well implemented tmpfs perhaps make `gcc' faster than
`gcc -pipe'?

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu