So limit the number of iterations of rejecting windows that are too
small. Say, 8.
Hans
Jeff Mahoney wrote:
>
> What's happening is that we keep finding windows that are too small,
> which results in a lot of wasted effort. The cycle goes like this:
>
> if (unfm && is_block_in_journal(s, bmap_n, *beg, beg))
> continue;
> /* first zero bit found; we check next bits */
> for (end = *beg + 1;; end++) {
> if (end >= *beg + max || end >= boundary
> || reiserfs_test_le_bit(end, bi->bh->b_data)) {
> next = end;
> break;
> }
> /* finding the other end of zero bit window requires
> * looking into journal structures (in
> * case of searching for free blocks for unformatted nodes) */
> if (unfm && is_block_in_journal(s, bmap_n, end, &next))
> break;
> }
>
> If the window is too small, we end up looping up to the top and try to
> find another one. Since the overwhelming majority of the windows are too
> small, we go through just about all the bitmaps without backing off the
> window size.
>
> -Jeff
>
> --
> Jeff Mahoney
> SUSE Labs