Re: Memory Mapped Filesystem

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Tue Mar 21 2000 - 17:59:55 EST


Thomas Pornin wrote:
> Therefore, I intend to implement such a filesystem. For this, I need
> some help; specifically, I ask myself the following questions:
> -- does such a filesystem already exists ?

Nearly. The recently added shmfs handles the memory management issues
and, being widely used, will get fairly thorough testing.

> -- would it be easier to modify the ramdisk to be able to be
> swapped out, and stubs in one filesystem to unmap unused pages ?
> -- how do I allocate memory from within the kernel, such that this
> memory might be swapped out ? I can do a do_mmap(), but, from
> my (rather low) understanding of the memory management in Linux,
> this mapping would be specific to one process. I could run
> a kernel thread (well, at least I believe I could) but I would
> run into the "Minix-single-threaded-filesystem".
> -- does all this make sense ? Is there a better solution ?

Most of what you ask has been carefully implemented for shmfs, except
for the filesystem part :-)

I.e., memory files were effectively added recently. However, I think
for tmpfs you need to add read/write support (shmfs only does mmap I
think), some way to extend/truncate the files, and a directory
structure.

> -- what happens if I create a file on such a filesystem and try to
> swapon it ?

Only one way to find out :-)

-- Jamie

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



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:34 EST