Re: [PATCH] mm/mmap.c find_vma(), kernel 2.4.0

Robert Wienholt, Jr. (rwienholt@legiontech.com)
Mon, 8 Jan 2001 00:29:24 -0500


>
>
> On Mon, 8 Jan 2001, Robert Wienholt, Jr. wrote:
>
> > Gentlemen,
> >
> > I was looking through some of the memory management code today and
> > came across something that may provide a minor performance boost. I have
> > included a patch below for the 2.4.0 source.
> >
> > In the find_vma function a cached vma is checked and if that is
> > not the requested vma, the linked list (unless there's an avl tree) is
> > traversed from the beginning. My thought was that if the cached vma is
> > somewhere in the middle of a "long" list, and the memory address we are
> ^^^^^^^^^^
> No such thing. If you get many VMAs you get AVL tree and that's what is
> used for search.
>

Well, that's why I put the "long" in quotes. If the cached vma is the
10th in the list and we're looking for the 12th... we'll go through the
traversal loop twice instead of 12 times. That's the point I was trying
to make. But if we're looking for the 3rd... we'll just start at the
beginning and no harm was done.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/