[Ocfs2-tools-devel] [PATCH 1/4] defrag.ocfs2: Fix alloc_cluster to allocate best clusters

Goldwyn Rodrigues rgoldwyn at gmail.com
Mon Jul 19 01:24:27 PDT 2010


On Sun, Jul 18, 2010 at 11:29 AM, Joel Becker <Joel.Becker at oracle.com> wrote:
> On Tue, May 11, 2010 at 11:02:30PM -0500, Goldwyn Rodrigues wrote:
>> alloc_clusters (alloc_range_func) currently scans all bitmap regions.
>> However, if it finds a cluster smaller than requested, it stops and
>> returns the allocation, instead of checking the rest of the bitmap
>> regions to check for a better cluster.
>>
>> This fix checks the rest of the bitmap regions to find the best
>> possible cluster allocation.
>>
>> Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.de>
>
>        If I understand this patch correctly, all allocations will
> always walk the entire bitmap until they find something contiguous,
> correct?

Yes, that is correct.

> Only after they reach the end will they use the best fit they
> found?
>

Not always. If a match bigger than requested is found, it returns
immediately and does not wait to check the rest of the bitmap. The
problem was it was trying to find the best match in the current bitmap
only.

This change was important because the defrag utility was getting only
small chunks when bigger were available.


-- 
Goldwyn



More information about the Ocfs2-tools-devel mailing list