From: Theodore Tso <tytso@mit.edu>
To: Clemens Eisserer <linuxhippy@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Status of ext4 online defrag?
Date: Fri, 24 Jul 2009 13:22:27 -0400 [thread overview]
Message-ID: <20090724172227.GH5675@mit.edu> (raw)
In-Reply-To: <194f62550907240829m1834bc26r8e23baba4b295ae4@mail.gmail.com>
On Fri, Jul 24, 2009 at 11:29:40AM -0400, Clemens Eisserer wrote:
> >> Does anybody know what the current state of ext4 online defrag is?
> >
> > It got merged for 2.6.31 (commit 748de6736c1e482e111f9d1b5a5d5b1787600cad)
>
> Thanks, how cool!
> I feared already that this feature is dead, glad to hear it is not :)
It's not dead, but it's not fully complete. There are more patches
that introduce a half-dozen or so new ioctl's that still need review,
and the e4defrag tool is still quite primitive and needs to (a) use
the new ioctls, and (b) be made more intelligent about defragging free
space.
At the moment what e4defrag will do is to ask the filesystem to
allocate new space, and if the new space contains fewer fragments that
the current file, use an ioctl to atomically copy the data to the new
blocks and swap the blocks so that the file being defragged uses the
newly allocated blocks. If the filesystem's free space is not badly
fragmented, this will tend to defrag individual files, but e4defrag
doesn't currently have any kind of global knowledge of where files
live and any global knowledge of the free space and how to move blocks
around so that the free space will get defragmented.
The new ioctls are designed to give the userspace program the tools to
do this, but (a) we haven't had the time to review the ioctls and new
code so they haven't been merged yet, and (b) the userspace program
hasn't been taught to use these new ioctls.
> When compiling e2fsprogs from git, I get:
> > e4defrag.c:388: error: conflicting types for ‘fallocate’
> > /usr/include/bits/fcntl.h:240: note: previous declaration of ‘fallocate’ was here
> > make: *** [e4defrag.o] Error 1
>
> I had to comment out fallocate in fcntl.h, no idea who is wrong here.
Eric Sandeen has patches that he sent out in the last two weeks to fix
e4defrag so it will compile on glibc's that define fallocate. I just
haven't had a chance to get them applied into mainline. Things like
fixing bugs where off-line resize2fs could corrupt ext4 filesystems
were higher priority. :-(
The bottom line is that online defrag is something that is happening,
it's just not happening as fast as we would all like, mainly due to
resource issues.
Regards,
- Ted
prev parent reply other threads:[~2009-07-24 17:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-24 13:36 Status of ext4 online defrag? Clemens Eisserer
2009-07-24 15:00 ` Diego Calleja
2009-07-24 15:29 ` Clemens Eisserer
2009-07-24 17:22 ` Theodore Tso [this message]
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=20090724172227.GH5675@mit.edu \
--to=tytso@mit.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxhippy@gmail.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