Re: [PATCH 0/4] ext3 block reservation patch set

Mingming Cao
2004-04-14T23:37:38Z

On Wed, 2004-04-14 at 16:07, Andrew Morton wrote:

> > The current implementation is more than O(n): every time it does not
> > have a reservation window, it search from the head of per filesystem
> > reservation window list head. If it failed within the group, it will
> > move to the next group and start the search from the head of the list
> > again.
>
> Same problem exists in arch_get_unmapped_area(). We have a funny little
> heuristic (free_area_cache) in there to speed up the common case.
Actually, we only hit this more than O(n) case when the file is just
opened for write(without reservation window). In the normal case, if we
have a old reservation window, we will start the from the old
reservation, instead of the head of whole filesystem list, to search for
next new reservable hole.

>
> > This could be fixed by forget about the block group boundary at
> > all,(remove the for loop in ext3_new_block), make it searchs for a block
> > in a filesystem wide:)
>
> I do think we should do this. Does it have any disadvantages?
>
I re-looked at the code today, my concern is, we may end of a big
changes to the existing code. Need to think it more....