[Ocfs2-tools-devel] [PATCH 0/4] defrag.ocfs2

tristan tristan.ye at oracle.com
Thu Mar 18 03:38:06 PDT 2010


Hi goldwyn,

Per my understanding,

pass1 disclaim the unused inode block groups back to global bitmap, the 
intention here is to leave more contiguous space in gb, and pass3 
therefore can perfrom a better defragmentation, right?

One question, why not also disclaim the unused extent block groups?

pass2 is packing the dirents from one extent to another, the sliding 
windows method looks awesome:)


pass3 is trying to fill the holes in bg by latter extents which fits best.

Am I understanding these in a wrong way?

And goldwyn,

I'm also wondering if you've got some interesting benchmark data during 
your lab testing to show the power of patch persuasively;)

Per my testing, I'm sorry to say that I even found a negative effect 
brought by your patches:(

==============================================
Fs without defrag
==============================================
Blocksize: 4096 bytes
Clustersize: 4096 bytes
Total clusters: 7325632
Free clusters: 6811198 (93.0%)

Min. free extent: 2044 KB
Max. free extent: 129020 KB
Avg. free extent: 120552 KB

Chunksize: 1048576 bytes (256 clusters)
Total chunks: 28616
Free chunks: 26381 (92.2%)

HISTOGRAM OF FREE EXTENT SIZES:
Extent Size Range : Free extents Free Clusters Percent
1M... 2M- : 1 511 0.01%
2M... 4M- : 2 1668 0.02%
4M... 8M- : 9 13815 0.20%
8M... 16M- : 2 7614 0.11%
32M... 64M- : 2 32254 0.47%
64M... 128M- : 210 6755336 99.18%


==============================================
Fs after defrag
==============================================
Blocksize: 4096 bytes
Clustersize: 4096 bytes
Total clusters: 7325632
Free clusters: 6811198 (93.0%)

Min. free extent: 4 KB
Max. free extent: 129020 KB
Avg. free extent: 101280 KB

Chunksize: 1048576 bytes (256 clusters)
Total chunks: 28616
Free chunks: 26379 (92.2%)

HISTOGRAM OF FREE EXTENT SIZES:
Extent Size Range : Free extents Free Clusters Percent
4K... 8K- : 1 1 0.00%
8K... 16K- : 3 8 0.00%
16K... 32K- : 9 50 0.00%
32K... 64K- : 5 48 0.00%
64K... 128K- : 6 135 0.00%
128K... 256K- : 6 294 0.00%
256K... 512K- : 8 725 0.01%
512K... 1024K- : 2 292 0.00%
1M... 2M- : 2 846 0.01%
2M... 4M- : 3 2414 0.04%
4M... 8M- : 8 11752 0.17%
8M... 16M- : 2 7443 0.11%
16M... 32M- : 1 7022 0.10%
32M... 64M- : 4 52979 0.78%
64M... 128M- : 209 6727189 98.77%


Disk layout reported by 'o2info' show us that the fs was even more 
fragmented after being defraged.


Anyway, I'll take much closer look on your 3 patches in detail.


Regards,
Tristan.

Goldwyn Rodrigues wrote:
> These patches adds a new tool to defrag ocfs2 filesystem.
> There are 3 passes - 
> Pass 1: Clears unused inode groups
> Pass 2: Defrags the directories, coalescing the directory entries
> Pass 3: Defrags the filesystem as a whole
>
> I haven't done defraging of files (merging of file extents) as yet.
> Algorithms and limitations are in patch headers of the pass they introduce.
>
> Disclaimer: Don't blame me if it eats your data ;)
>
> Comments/Suggestions welcome.
>
>   




More information about the Ocfs2-tools-devel mailing list