Re: Solaris tmpfs vs. Linux RAMdisk

Walter Hofmann (Walter.Hofmann@physik.stud.uni-erlangen.de)
Sat, 17 Apr 1999 19:22:25 +0200 (MEST)


-----BEGIN PGP SIGNED MESSAGE-----

On Sat, 17 Apr 1999, Jim Nance wrote:

> On Fri, Apr 16, 1999 at 09:46:09PM +0200, Walter Hofmann wrote:
> > I get the following results:
> >
> > wh@frodo:~ > ./test /home/wh
> > Did 14137 loops in 2.99 seconds (4724.35 loops/sec)
> > wh@frodo:~ > ./test /tmp
> > Did 15923 loops in 2.99 seconds (5322.36 loops/sec)
> > wh@frodo:~ > ./test /usr/local/tmp
> > Did 28783 loops in 3.00 seconds (9596.10 loops/sec)
> >
> > /home and /tmp are on the same ext2 partition (486M, 84% filled)
> > /usr is an (soft-)raid0 array (4G, 81% filled, 2 disks)
> >
> > There is virtually no disk access during the test, the results are stable
> > over many runs.
> >
> > Yet there is one big question: Why is the raid0-array twice as fast when
> > there is no disk access???
>
> The number of files in the directory definitly makes a difference. This is
> because the kernel has to look through all the directory entries to make
> sure the file does not already exist. Could this be it?

wh@frodo:~/programming/testing > gcc -O3 tmpfs.c -o tmpfs
wh@frodo:~/programming/testing > mkdir /home/wh/newdir
wh@frodo:~/programming/testing > ./tmpfs /home/wh/newdir/
Did 26071 loops in 3.00 seconds (8692.22 loops/sec)
wh@frodo:~/programming/testing > mkdir /usr/local/tmp/newdir
wh@frodo:~/programming/testing > ./tmpfs /usr/local/tmp/newdir/
Did 32696 loops in 3.00 seconds (10912.29 loops/sec)
wh@frodo:~/programming/testing > mkdir /tmp/newdir
wh@frodo:~/programming/testing > ./tmpfs /tmp/newdir/
Did 25906 loops in 3.00 seconds (8643.41 loops/sec)

This seems to explain the difference between /home/wh and /tmp, which are
both on the same partition. But the RAID0 array /usr is still faster.

Walter

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Charset: noconv

iQCVAwUBNxjDVfzeA3/eVHOFAQHCdAP/XXSbSJA2mND0p3XIkhrNtop25mCuMd0f
lgPN7XfUAHHBbjJKhJLnCOVxK6p/liU0qcH7pRmqG4UKJ+uMjB5KEI/W4TgVLOSN
3WTUHhStTPTJgS5o31Ud+ZOo9t99ndIOhiafveFGHYfC5lOkjPAQaaEWgQ6XCQ9Y
THENDrxfpOI=
=Z7PA
-----END PGP SIGNATURE-----

-
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/