e4defrag: fragmentation score rework and cleanups
Quoted 4 lines
Hi,
This patch set adds the new function
get_fragment_score()to libe2p, that calculates the fragmentation score. Fragmentation score shows how badly
Out of curiosity: is there a minimal kernel version requirement (one which can be safely used with e4defrag)?
Signature · 2 lines
Tomasz Chmielewski http://wpkg.org
Quoted 1 line · Tomasz Chmielewski
Out of curiosity: is there a minimal kernel version requirement (one which can be safely used with e4defrag)?
EXT4_IOC_MOVE_EXT ioctl was merged 2.6.31. And then some bugfix were merged before 2.6.35. I suggest you to build 2.6.35 or later if you try to do e4defrag.
e4defrag also merged some bugfix like this patch, so you should use the latest e4defrag.
If you find out something about online defrag, please post a comment.
Regards,
Kazuya Mio
Quoted 10 lines · Kazuya Mio
Quoted 2 lines · Tomasz Chmielewski
Out of curiosity: is there a minimal kernel version requirement (one which can be safely used with e4defrag)?
EXT4_IOC_MOVE_EXTioctl was merged 2.6.31. And then some bugfix were merged before 2.6.35. I suggest you to build 2.6.35 or later if you try to do e4defrag.e4defrag also merged some bugfix like this patch, so you should use the latest e4defrag.
Thanks for clarification.
Quoted 1 line
If you find out something about online defrag, please post a comment.
My main usage for e4defrag would be defragmenting virtual guest (like KVM) file-based images.
These images are typically quite small when created (i.e. qcow2, or a "raw", sparse file), but grow in time, which leads to serious fragmentation.
I noticed that when using e4defrag on such a file-based image, while the guest is running (i.e. the file is in use), all IO from that guest to the disk (disk is this file) is "frozen".
In other words, as soon as we run e4defrag, any guest writes to that file will only complete if e4defrag finishes. As the images can be quite big, it can mean guest IO can be frozen even for hours.
Is it a known/intended limitation (at least, it behaved like this when I tried e4defrag a few months ago)?
In some cases, it can be a serious drawback, potentially leading to filesystem corruption in the guest - if guest block layer is SCSI, with default settings (at least in Linux) it may detect that no IO happened for some time, and just "offline" the disk.
Signature · 2 lines
Tomasz Chmielewski http://wpkg.org
Quoted 11 lines · Tomasz Chmielewski
I noticed that when using e4defrag on such a file-based image, while the guest is running (i.e. the file is in use), all IO from that guest to the disk (disk is this file) is "frozen".
In other words, as soon as we run e4defrag, any guest writes to that file will only complete if e4defrag finishes. As the images can be quite big, it can mean guest IO can be frozen even for hours.
Is it a known/intended limitation (at least, it behaved like this when I tried e4defrag a few months ago)?
Thank you for the feedback. I will try to reproduce this problem later.
Regards,
Kazuya Mio
Quoted 11 lines · Kazuya Mio
Quoted 10 lines · Tomasz Chmielewski
I noticed that when using e4defrag on such a file-based image, while the guest is running (i.e. the file is in use), all IO from that guest to the disk (disk is this file) is "frozen".
In other words, as soon as we run e4defrag, any guest writes to that file will only complete if e4defrag finishes. As the images can be quite big, it can mean guest IO can be frozen even for hours.
Quoted 7 lines
Quoted 2 lines
Is it a known/intended limitation (at least, it behaved like this when I tried e4defrag a few months ago)?
Thank you for the feedback. I will try to reproduce this problem later.
Regards,
Kazuya Mio
Kazuya,
When trying to come up with a better plan for handling large files, you may want to review this msg and Akira's response from last spring:
http://www.kerneltrap.com/mailarchive/linux-ext4/2010/3/30/6899823
Greg