Subject: tmpfs: Project's code ready
To: None <tech-kern@netbsd.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-kern
Date: 08/26/2005 11:18:16
Hi all,

I'm glad to announce that tmpfs' code is now in a state that is
testable and so-so usable.  There are still some issues with
it that must be fixed, so don't expect too much stability (and
in a second order of things, speed).  Check the TODO file in
the source tree for more details.

Why am I announcing it, then?  Because I won't have the time to
do any further serious improvements on the code before SoC's
deadline arrives (August 31st).  I am currently working on the
project's documentation, and, while this has already taken several
days, I'll need all the remaining ones to get it to a decent shape.

However, don't be worried!  I plan to continue tmpfs'
development after SoC ends.  I would like it to reach maturity to
later incorporate it into NetBSD.

Having said this, let's see how to test and use the file-system:

1) Fetch a recent copy of NetBSD-current sources or make
   sure the one you have is up to date.  We'll assume it is
   stored in /usr/src.

2) Fetch tmpfs' sources.

   cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/netbsd-soc login
       (Press return when asked for a password.)
   cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/netbsd-soc
co -P tmpfs

3) Enter into tmpfs' source directory (cd tmpfs).

4) Ensure that the patches are newer than your source code;
   otherwise, automatic patching will fail.  Ew.

   touch patches/*.diff

5) Merge tmpfs' sources into your NetBSD source tree:

   NETBSDSRCDIR=3D/usr/src; export NETBSDSRCDIR
   sh ./setup.sh

6) Add 'file-system TMPFS' into your kernel configuration file.

7) Rebuild, install and boot the new kernel.

8) Go to ${NETBSDSRCDIR}/sbin/mount_tmpfs to build and
   install the mount_tmpfs(8) utility:

   make USETOOLS=3DNO dependall install

9) Run the regression test suite (must be run as root!).
   The project's webpage contains more information about
   this.

   cd ${NETBSDSRCDIR}/regress/sys/fs/tmpfs
   make regress TEST_ARGS=3D'-usomebody -v2'
       (Where 'somebody' is the name of your regular user
       account.)

10) The regression test suite should pass without any
    failure.  If that is not the case, please report.

11) Mount a tmpfs file-system anywhere you want:

   mount -t tmpfs swap /mnt/foo
   mount -t tmpfs -o -s10M /mnt/bar

12) Enjoy!

13) Optionally read the tmpfs(9) manual page to learn a
    bit about its internals.

    cd ${NETBSDSRCDIR}/share/man/man9
    groff -Tascii -mdoc tmpfs.9 | less

Note: I think that the most serious issues with tmpfs come
when using a file-system that is too big.  This is not a
certain thing yet, but I'd suggest you to delimit its size by
using the '-s' flag to the mount command, as said in one of
the previous examples.

For example, I can reproduce a crash by mounting an
unlimited tmpfs file-system in my system (1gb ram, 2gb
swap) and unpacking a pkgsrc tarball into it.  (An UVM
assertion is triggered...)

Don't hesitate to report any bugs you find, even if they are
trivial.

Thanks for your attention!

--=20
Julio M. Merino Vidal <jmmv84@gmail.com>
http://www.livejournal.com/users/jmmv/
The NetBSD Project - http://www.NetBSD.org/