Re: [RFC 0/7] [RFC] cramfs: fake write support

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Arnd Bergmann <arnd@...>, Jamie Lokier <jamie@...>, Phillip Lougher <phillip@...>, David Newall <davidn@...>, <linux-fsdevel@...>, <linux-kernel@...>, <hch@...>
Date: Sunday, June 1, 2008 - 11:51 pm

> Jamie Lokier wrote:

Yes, unionfs does copyup whole files, but it doesn't lock the entire file
into the page cache.  But I agree, that copying up large files to a tmpfs
partition adds more memory pressure, at least temporarily (until pdflush
kicks in).


If I understand you right, you want to copyup one page at a time, right?
That's not nearly as easy as one might imagine.  First, you can't do it on
file systems which don't support holes.  Second, holes is a file-systems
specific implementation issue, and the knowledge of holes AFAIC, is hidden
from the VFS (IIRC, FreeBSD has a specific "zfod" page flag, which is turned
on when the VM has a page that came out of a f/s hole).

You'll need a way to tell if a given page was copied up or not, and
distinguish b/t pages which are naturally filled with zeros vs. those which
came from f/s holes.

Copyup is also providing persistency: you can copyup to a persistent f/s
such as ext2.  So you'll need a bitmap or some sort of record that will
survive file system remount and system reboot; such a bitmap will have to
tell which pages of a file have been copied up or not.

I'm not saying it's not possible, but it's to do this page-wise caching at a
stackable layer than inside a native f/s such as ext2.  Now, if there was a
generic VFS op that allowed me to query a file system whether a page it a
given file is a hole or not, then unionfs would be able to do page-wise
copyup easily.

Frankly, I think something like support for a copied-up file, page-by-page,
should probably be supported by a block layer virtual driver (this might be
easier in a BSD-like geom layer.)

BTW, I believe FSCache has page-wise caching, right?  Caching is a
copy-on-read operation, and it doesn't take much to make it cache (read:
copy) on writes.  So FScache might be a good starting point for such an
effort.


I think a union-tmpfs is a better solution than a cramfs-specific one, b/c
at least with union-tmpfs, many more users could use it.  Even if you
restrict yourself to using tmpfs as the r-w layer, and read-only from just
one other source f/s, that still will cover a large portion of unioning
users.


Cheers,
Erez.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC 0/7] [RFC] cramfs: fake write support, Phillip Lougher, (Sat May 31, 11:19 pm)
Re: [RFC 0/7] [RFC] cramfs: fake write support, David Newall, (Sat May 31, 2:56 pm)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Arnd Bergmann, (Sat May 31, 4:40 pm)
Re: [RFC 0/7] [RFC] cramfs: fake write support, David Newall, (Sun Jun 1, 2:02 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Jan Engelhardt, (Sun Jun 1, 5:11 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Phillip Lougher, (Sat May 31, 11:54 pm)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Jamie Lokier, (Sun Jun 1, 8:28 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Arnd Bergmann, (Sun Jun 1, 5:49 pm)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Arnd Bergmann, (Mon Jun 2, 3:12 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support , Erez Zadok, (Mon Jun 2, 11:35 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Arnd Bergmann, (Mon Jun 2, 7:15 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Evgeniy Polyakov, (Mon Jun 2, 10:54 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Arnd Bergmann, (Mon Jun 2, 1:42 pm)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Arnd Bergmann, (Mon Jun 2, 10:13 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Arnd Bergmann, (Mon Jun 2, 11:01 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support , Erez Zadok, (Mon Jun 2, 12:37 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support , Jan Engelhardt, (Mon Jun 2, 3:17 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Bharata B Rao, (Mon Jun 2, 2:07 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support , Erez Zadok, (Sun Jun 1, 11:51 pm)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Jamie Lokier, (Mon Jun 2, 7:07 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support , Erez Zadok, (Sun Jun 1, 11:25 pm)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Arnd Bergmann, (Mon Jun 2, 3:51 am)
Re: [RFC 0/7] [RFC] cramfs: fake write support , Erez Zadok, (Mon Jun 2, 2:13 pm)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Phillip Lougher, (Mon Jun 2, 10:02 pm)
Re: [RFC 0/7] [RFC] cramfs: fake write support, Arnd Bergmann, (Sun Jun 1, 4:52 am)