User: Password:
|
|
Subscribe / Log in / New account

Online defragmentation for ext4

Online defragmentation for ext4

Posted Feb 5, 2009 3:40 UTC (Thu) by dtlin (✭ supporter ✭, #36537)
Parent article: Online defragmentation for ext4

XFS already has working online defragmentation, via xfs_fsr and ioctl(XFS_IOC_SWAPEXT). Has anybody mentioned why online defragmentation ext4 can't just use the same interfaces?


(Log in to post comments)

Online defragmentation for ext4

Posted Feb 5, 2009 5:53 UTC (Thu) by dgc (subscriber, #6611) [Link]

The algorithm for creating a new file, preallocating and comparing
extents before doing any data movement is pretty much the same as what
xfs_fsr does. however, they differ in teh method of data exchange
algorithms.

xfs_fsr does all the data movement via direct IO in userspace
(i.e. scales extremely well). It swaps the extents atomically
if the inode has not changed between the start of the data copy
and the completion of it. Hence you can't defragment active files.

This was considered a fundamental blocker for ext4 even though
most active files never need defragmentation (think shared
libraries). Hence the ext4 patchset implements data movement inside
ext4 itself and so the kernel defrag code is much, much more complex
than the XFS swap extents ioctl. Userspace complexity is about the
same, but different APIs were required for ext4 to do it's "a bit at
a time" algorithm....


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds