[Ocfs2-tools-devel] [PATCH 2/2] defrag.ocfs2: Clear unused inode groups

Goldwyn Rodrigues rgoldwyn at gmail.com
Fri Feb 26 07:04:37 PST 2010


Hi,

I picked up the task from the task list, which states removing unused
inode_groups. However, there are more steps which I am currently
developing/thinking. Mark suggested that I could post the current
patch to get it reviewed.

>
> I am trying to understand the goal here. How will freeing unused
> inode_alloc groups defragment the volume? Is this a step 1 in a multi
> step process? If so, can you elaborate on the rest.

It merely reclaims the unused inode groups. Step 1 is not a multi-step
process, but might be as it evolves.

The rest of the steps, which follow as I have planned will be:

Pass 2: Internal defragmentation (of file defragmentation)

For files, Coalesce smaller extents to larger ones so total number of
extents are reduced. I do not want to merely copy the file extents and
do not have any leads on this and comments/ideas will be welcome.
Perhaps could be combined with Step 3 (discussed later)

I was also planning to put the puncher (optional) in this, but it is a
long shot.

Directories, dirents will be coalesced not only _within_ blocks (like
the fsck patch I posted), but _across_ extents. finally the directory
gets truncated to relieve the free space. I am currently working on
this and will post the patches shortly. Finally feed directory inode
to file defragmentation to coalesce extents.

Pass 3: External defragmentation (or filesystem defragmentation)
Move extents as a whole (and update inodes) to remove gaping holes
within the filesystem.

Stray idea:
Moving file/directory inodes to the inode groups in which the parent
belong to improve lookup times.


>
> BTW, Wengang did document his thoughts on the subject.
> http://oss.oracle.com/osswiki/OCFS2/DesignDocs/defragmentation
>

I did consult this to come up with the ideas. For the power failure, I
might need a filesystem flag, but I will avoid it as much as possible.

> At that time I felt online defrag is the only solution. But my thinking
> has evolved. Right now I think any defrag tool that increases freespace
> space contiguousness is good. Offline and/or online.
>

Glad I triggered your thinking  ;)

--
Goldwyn



More information about the Ocfs2-tools-devel mailing list