From: Andrew Morton <akpm@zip.com.au>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Chris Mason <mason@suse.com>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [patch 12/16] fix race between writeback and unlink
Date: Tue, 04 Jun 2002 15:08:45 -0700 [thread overview]
Message-ID: <3CFD3A6D.6DC93964@zip.com.au> (raw)
In-Reply-To: <3CFD25A2.FCC7F66A@zip.com.au> <Pine.LNX.4.44.0206041428080.983-100000@home.transmeta.com>
Linus Torvalds wrote:
>
> On Tue, 4 Jun 2002, Andrew Morton wrote:
> >
> > There's a patch at
> > http://www.zip.com.au/~akpm/linux/patches/2.4/2.4.19-pre10/ext3-reloc-page.patch
> > which provides a simple `relocate page' ioctl for ext3 files.
>
> That's a good start, but before even egtting that far there is some need
> for a way to get a picture of the FS layout in a reasonably fs-independent
> way.
>
> Sure, bmap() actually does part of this (the "where are my blocks" part),
> but right now there is no way to query the FS for the "where can I put
> blocks" part.
Jeff Garzik was working on that a while back - a separate filesystem
which provides a "metadata view" of a real filesytem. So you can
poke around and find all these things out. In theory, different
filesystems should be able to offer the same view.
> You can do it with direct disk access and knowledge of the FS internals,
> but it should not be all that hard to add some simple interface to get a
> "block usage byte array" kind of thing (more efficient than doing bmap on
> all files, _and_ can tell about blocks reserved for inodes, superblocks
> and other special uses), which together with a user-level interface to
> "preallocate" and your "relocate page" should actually make it possible to
> make a fairly FS-independent defragmenter.
The e2fsprogs package includes a `libe2fs' library which offers
APIs for accessing the fs internals. It's exactly what you
say - direct disk access and knowledge of internals. So
that plus the try_to_relocate_page() ioctl is a shortest-path
route to a defragmenter for ext3, and only ext3. I wasn't
aiming very high here ;)
A totally different way of performing defrag could be to
copy the entire fs from one partition to a different one,
with kernel support for providing coherency while the copy
is in progress. It's basically a union/translucent mount
with COW. Swizzle the backing blockdev, drop the disk
mappings from all incore pages, renumber the inode without
breaking stuff... (OK, I've talked myself out of it ;/) It's
not super efficient, and it does require the provisioning of a
bounce disk, but it would use infrastructure which would be
useful for other stuff and it is fs-agnostic.
-
next prev parent reply other threads:[~2002-06-04 22:11 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-01 8:43 [patch 12/16] fix race between writeback and unlink Andrew Morton
2002-06-01 16:42 ` Linus Torvalds
2002-06-01 19:19 ` Andrew Morton
2002-06-01 20:04 ` William Lee Irwin III
2002-06-01 22:25 ` Andrew Morton
2002-06-03 4:27 ` [RFC] iput() cleanup (was Re: [patch 12/16] fix race between writeback and unlink) Linus Torvalds
2002-06-03 16:26 ` Andreas Dilger
2002-06-03 16:47 ` Linus Torvalds
2002-06-03 19:09 ` Chris Mason
2002-06-03 19:34 ` Linus Torvalds
2002-06-03 19:49 ` Chris Mason
2002-06-03 19:55 ` Linus Torvalds
2002-06-03 22:10 ` [patch 12/16] fix race between writeback and unlink Chris Mason
2002-06-03 22:19 ` Linus Torvalds
2002-06-03 22:30 ` Andrew Morton
2002-06-04 18:47 ` Linus Torvalds
2002-06-04 20:15 ` Andrew Morton
2002-06-04 20:23 ` Linus Torvalds
2002-06-04 20:40 ` Andrew Morton
2002-06-04 21:37 ` Linus Torvalds
2002-06-04 22:04 ` Benjamin LaHaise
2002-06-04 22:08 ` Andrew Morton [this message]
2002-07-07 20:38 ` Riley Williams
2002-06-04 22:05 ` Craig Milo Rogers
2002-06-04 22:08 ` Linus Torvalds
2002-06-03 22:36 ` Chris Mason
2002-06-03 22:47 ` Andrew Morton
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=3CFD3A6D.6DC93964@zip.com.au \
--to=akpm@zip.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=mason@suse.com \
--cc=torvalds@transmeta.com \
/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