[OracleOSS] [TitleIndex] [WordIndex]

OCFS2/DesignDocs/defragmentationonfile

ocfs2 de-fragmentation on file.

backgroud

for files having too many fragments, I/O performance on them is bad because of more I/O by ocfs2 and the more seeking time of disk headers.

de-fragment tool

this is a de-fragment tool which de-fragments on files(not on bitmaps) to make less fragments.

detail of merging extent-records for a file.

1) reads meta blocks (inode and extent-blocks) for a file into memory.

2) reads all extent-records in meta blocks to a list named all-extent-records-list which is used to hold all extent-records

3) if the sum of extent-records <= TRESHOLD(a fixed value specified as parameter or a default), abort the merging for the file.

4) re-alloc data clusters.

journaling

to guarantee the safety of meta, journal is needed. Here, jbd is used. it's implemented by a kernel module making use of jbd. it offers interface to user space via ioctls. the jbd will use the journal file in ocfs2 as it's journaling blocks. when started, let jbd do journaling if there are valid journaling blocks.

safety

for meta, journaling is used, it can guarantee the safety of meta; for data, we are writing copies of the original, there is no destroy on original data. and if crash occurred when reallocating bitmaps or coping data, meta is not modified, it's still safe. so this tool is safe.

limitations

1) this tool have to be run offline.

2) suit for large files -- for small files, copying out in copying in(with changing inode number) solves the problem as Sunil always suggest users to do :P


2011-12-23 01:01