From: Jamie Lokier <jamie@shareable.org>
To: Erez Zadok <ezk@cs.sunysb.edu>
Cc: Arnd Bergmann <arnd@arndb.de>,
Phillip Lougher <phillip@lougher.demon.co.uk>,
David Newall <davidn@davidnewall.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
hch@lst.de
Subject: Re: [RFC 0/7] [RFC] cramfs: fake write support
Date: Mon, 2 Jun 2008 12:07:08 +0100 [thread overview]
Message-ID: <20080602110708.GE31032@shareable.org> (raw)
In-Reply-To: <200806020351.m523p7Lw026335@agora.fsl.cs.sunysb.edu>
Erez Zadok wrote:
>
> > Jamie Lokier wrote:
> > > Phillip Lougher wrote:
> > > If I read the patches correctly, when a file page is written to, only
> > > that page gets copied into the page cache and locked, the other pages
> > > continue to be read off disk from cramfs? With Unionfs a page write
> > > causes the entire file to be copied up to the r/w tmpfs and locked into
> > > the page cache causing unnecessary RAM overhead.
>
> 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).
1: I'm thinking systems which have union-over-cramfs probably don't have
swap at all...
2: It's a problem when you modify a very large file, even on a fast PC
with plenty of RAM. LVM snapshots might be better for this sort of
thing.
> > Ok, so why not fix that in unionfs? An option so that holes in the
> > overlay file let through data from the underlying file sounds like it
> > would be generally useful, and quite easy to implement.
>
> 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).
True, although the new FIEMAP ioctl is supposed to make holes more
filesystem independent, when they are supported.
> 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.
Metadata. Don't you have other metadata anyway, like whiteouts? :-)
> 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.
Yes.
> 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.
See FIEMAP. Is it any use?
-- Jamie
next prev parent reply other threads:[~2008-06-02 11:07 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-31 15:37 [RFC 0/7] [RFC] cramfs: fake write support arnd
2008-05-31 18:56 ` David Newall
2008-05-31 20:40 ` Arnd Bergmann
2008-06-01 3:54 ` Phillip Lougher
2008-06-01 8:52 ` Arnd Bergmann
2008-06-01 12:28 ` Jamie Lokier
2008-06-01 21:49 ` Arnd Bergmann
2008-06-02 2:48 ` hooanon05
2008-06-02 3:25 ` Erez Zadok
2008-06-02 7:51 ` Arnd Bergmann
2008-06-02 18:13 ` Erez Zadok
2008-06-03 2:02 ` Phillip Lougher
2008-06-02 3:51 ` Erez Zadok
2008-06-02 11:07 ` Jamie Lokier [this message]
2008-06-02 4:37 ` Erez Zadok
2008-06-02 6:07 ` Bharata B Rao
2008-06-02 7:17 ` Jan Engelhardt
2008-06-02 7:12 ` Arnd Bergmann
2008-06-02 10:36 ` hooanon05
2008-06-02 11:15 ` Arnd Bergmann
2008-06-02 12:56 ` hooanon05
2008-06-02 14:13 ` Arnd Bergmann
2008-06-02 14:33 ` hooanon05
2008-06-02 15:01 ` Arnd Bergmann
2008-06-03 11:04 ` hooanon05
2008-06-02 14:54 ` Evgeniy Polyakov
2008-06-02 17:42 ` Arnd Bergmann
2008-06-02 15:35 ` Erez Zadok
2008-06-01 6:02 ` David Newall
2008-06-01 9:11 ` Jan Engelhardt
2008-06-01 16:25 ` Jörn Engel
2008-06-01 3:19 ` Phillip Lougher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080602110708.GE31032@shareable.org \
--to=jamie@shareable.org \
--cc=arnd@arndb.de \
--cc=davidn@davidnewall.com \
--cc=ezk@cs.sunysb.edu \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=phillip@lougher.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).