Re: Solaris tmpfs vs. Linux RAMdisk

Jim Nance (jlnance@avanticorp.com)
Thu, 15 Apr 1999 08:44:34 -0400


On Wed, Apr 14, 1999 at 08:35:23PM -0700, George Bonser wrote:
> On Wed, 14 Apr 1999, Robert Kiesling wrote:
>
> > > Notice how Linux writting to an ext2 file system is significantly faster
> > > than any other OS/FS combination. The next closest is Solaris writting
> > > to tmpfs, and its still far behind ext2. Its also good to notice how
> > > slow both Solaris and Digital Unix are on their local file systems. This
> > > is probably why both have a ram base file system.

> I think this is because when you time ext2 you are actually timing the
> speed at which Linux writes to the disk BUFFER, not to the disk. The other
> operating systems do not return from a write until the data is really on
> the disk, if I remember correctly. ext2 returns nearly immediately. In
> other words, just because ext2 says the data was written to disk, it does
> not make it so in reality.

Almost all Unixlike operating systems buffer reads and writes to local files,
because, as you say, writting through a buffer is significantly faster than
writting directly to disk. Thats not what this program is trying to measure
though. The difference that I am trying to measure is the effect that doing
buffering on the file system metadata makes.

So I would say that for all Unixlike operating systems just because the
local file system says the data is on the disk does not mean its really
there. However with Linux we can go a step further: Just because the
file system says the file exists in a directory does not mean its really
in the directory on the disk.

Normally all this buffering is a good thing. It makes programs run MUCH
faster. The only time it matters where the data is really stored is when
someone kicks the plug out of the wall and the system goes down uncleanly.
When it comes back up, data that you wrote to files may no longer be in those
files. The difference between Linux and say Solaris is that with Solaris every
file that you created before the crash will exist after the crash even though
it may contain corrupted data. With Linux it is possible that files you
created before the crash will not exist after the crash. Every now and again
there are vigorous debates on this list about which one of these behaviors is
safer in the case of a crash, but thats not really relivant if you are
comparing it to a ramdisk :-)

Thanks,

Jim

PS: There is a bug in the benchmark program I posted yesterday. It should be
using the tv_usec field to calculate microseconds instead of the tv_sec
field. I reran the tests with this fix in and it does not make a
significant difference in the results.

-- 
----------------------------------------------------------------------------
Jim Nance                                                 Avant! Corporation
(919) 941-6655    Do you have sweet iced tea?       jim_nance@avanticorp.com
                  No, but there's sugar on the table.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/