Skip to content

Commit

Permalink
ocfs2: Always try for maximum bits with new local alloc windows
Browse files Browse the repository at this point in the history
What we were doing before was to ask for the current window size as the
maximum allocation. This had the effect of limiting the amount of allocation
we could get for the local alloc during times when the window size was
shrunk due to fragmentation. In some cases, that could actually *increase*
fragmentation by artificially limiting the number of bits we can accept. So
while we still want to ask for a minimum number of bits equal to window
size, there is no reason why we should limit the number of bits the local
alloc should accept. Hence always allow the maximum number of local alloc
bits.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
  • Loading branch information
Mark Fasheh authored and Joel Becker committed Mar 18, 2010
1 parent fcefd25 commit b22b63e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/ocfs2/localalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,7 @@ static int ocfs2_local_alloc_reserve_for_window(struct ocfs2_super *osb,
}

retry_enospc:
(*ac)->ac_bits_wanted = osb->local_alloc_bits;

(*ac)->ac_bits_wanted = osb->local_alloc_default_bits;
status = ocfs2_reserve_cluster_bitmap_bits(osb, *ac);
if (status == -ENOSPC) {
if (ocfs2_recalc_la_window(osb, OCFS2_LA_EVENT_ENOSPC) ==
Expand Down Expand Up @@ -1061,6 +1060,7 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb,
OCFS2_LA_DISABLED)
goto bail;

ac->ac_bits_wanted = osb->local_alloc_default_bits;
status = ocfs2_claim_clusters(osb, handle, ac,
osb->local_alloc_bits,
&cluster_off,
Expand Down

0 comments on commit b22b63e

Please sign in to comment.