Tmpfs?

Rauli Ruohonen (raulir@fishy.pp.sci.fi)
Wed, 13 Aug 1997 18:51:14 +0300


In article <9708131253.AA14255@halfpint.rtp.avanticorp.com>, Jim Nance wrote:
>> Is anybody working on a tmpfs-like filesystem for Linux? If not, I'll
>> consider having a go at it...
>
>I think one of the reasons Sun uses tmpfs is because file accesses are
>much faster under SunOS/Solaris if you use a memory based file system.
>This turns out not to be true for Linux. The difference is that we
>cache metadata and Sun does not. If you want to see the performance
>differences run the program attached to the end of this email on a Solaris
>machine with a tmpfs /tmp and a normat /usr/tmp using these arguments:

.. This gives me an idea: Is it possible to speed up things even more, by
making a "tmpfs" that wouldn't care a bit if the data is lost at boot, it
would only care about maximal performance? Maybe a tmpfs which had a
contiguous area marked as "swap_grow", so those blocks would be consumed last
by the temp files if it's really necessary? And maybe kernel should do some
defragmenting of this if the disk isn't busy.

This reminds me of one thing: What about dynamic swap priorities, based on
how active and speedy the different disks are? The speed could be told to the
kernel by adding a priority modifier, which would be added to the
"usage penalty" value.
If my disk can do 1MB/s, and another 3MB/s, I would set the priorities to
1 and 3, and the kernel would determine that when 3MB/s disk is used at
3MB/s, it's really wise to use the 1MB/s disk :) And maybe kernel could
at spare time write the data to both disks, so when you need to read the
data and it's in both you get the one with the least "usage penalty".
Of course when the swap starts to get full the duplicates would be discarded.

-- 
1 + 1 = 3, for large values of 1.