All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Andreas Dilger <adilger@clusterfs.com>
Cc: Jan Kara <jack@suse.cz>,
	sho@tnes.nec.co.jp, linux-ext4@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [RFC][PATCH 2/3] Move the file data to the new blocks
Date: Wed, 7 Feb 2007 12:56:59 -0800	[thread overview]
Message-ID: <20070207125659.bc27404d.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070207204657.GC6565@schatzie.adilger.int>

On Wed, 7 Feb 2007 13:46:57 -0700
Andreas Dilger <adilger@clusterfs.com> wrote:

> On Feb 06, 2007  17:35 -0800, Andrew Morton wrote:
> > On Mon, 5 Feb 2007 14:12:04 +0100
> > Jan Kara <jack@suse.cz> wrote:
> > > > Move the blocks on the temporary inode to the original inode
> > > > by a page.
> > > > 1. Read the file data from the old blocks to the page
> > > > 2. Move the block on the temporary inode to the original inode
> > > > 3. Write the file data on the page into the new blocks
> > >   I have one thing - it's probably not good to use page cache for
> > > defragmentation.
> > 
> > Then it is no longer online defragmentation.  The issues with maintaining
> > correctness and coherency with ongoing VFS activity would be truly ghastly.
> > 
> > If we're worried about pagecache pollution then it would be better to control
> > that from userspace via fadvise().
> 
> It should be possible to have the online defrag tool lock the inode against
> any changes,

Sounds easy when you say it fast.  But how do we "lock" against, say, a
read pagefault?  Only by writing back then removing the pagecache page then
reinstantiating it as a locked, not-uptodate page and then removing it from
pagecache afterwards prior to unlocking it.  Or something.

I don't think we want to go there.

> flush all pages out of the cache for that inode, and then do
> the reallocated outside of the page cache.  For inodes not already in cache
> this is a no-op.  For the (hopefully rare) case were the inode already has
> cached pages and also needs to be reallocated it would be a performance hit.
> 
> Alternately, we could skip files currently being modified (or mmaped), or
> even recently modified (e.g. within the last 30 minutes) in the default case,
> on the assumption that they might be deleted soon anyways.

argh.

It's simple to just use pagecache.  The "we don't want to swamp the machine
with pagecache" argument is bogus.  If it becomes a problem (and it might
not) then it is very simple to control the pagecache from userspace.

  reply	other threads:[~2007-02-07 20:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-16 12:05 [RFC][PATCH 2/3] Move the file data to the new blocks sho
2007-02-05 13:12 ` Jan Kara
2007-02-05 22:06   ` Nathan Scott
2007-02-07  1:35   ` Andrew Morton
2007-02-07 20:46     ` Andreas Dilger
2007-02-07 20:56       ` Andrew Morton [this message]
2007-02-08  9:29         ` Jan Kara
2007-02-08  9:45           ` Andrew Morton
2007-02-08 10:21             ` Jan Kara
2007-02-08 10:32               ` Andrew Morton
2007-02-08 10:47                 ` Jan Kara
2007-02-12  3:11                   ` Theodore Tso
2007-02-07  1:33 ` Andrew Morton
2007-02-07  3:45   ` Eric Sandeen
2007-02-07  9:46     ` Takashi Sato
  -- strict thread matches above, loose matches on Subject: below --
2007-02-08  9:01 Takashi Sato
2006-12-22 10:30 sho
2006-11-09 11:10 sho

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=20070207125659.bc27404d.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=adilger@clusterfs.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sho@tnes.nec.co.jp \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.