vma rbtree and vma merging

vma rbtree and vma merging

Post by Andrea Arcangel » Sat, 18 Aug 2001 14:00:08

I rewrote the vma lookup engine with a rbtree, it drops many browse of
the tree in many places this way and it drops the complexity of
rebalancing the tree as well. There is still some room for improvements
(get_unmapped_area walks the tree one more time in the non MAP_FIXED
case and we could checkpoint there but it would pollute some other code
and I thought it was a lower prio).

It also hopefully does the right merging for the anon mappings for mmap,
mremap and mprotect in all the cases (I got some mremap bit from Ben's
patch).  It's still very early work so don't apply it in any production
box but it works for me so far (running kde pre-2.9 over it, konqueror,
mutt, emacs, and some test programs and found no problems yet). I also
included it under the name of 70_mmap-rb-3 in the 2.4.9aa1 patchkit but
please make sure to back it out from the patchkit before doing any
production work. It needs to be tested better and it also needs to be
benchmarked carefully (should be a speed improvement).

against 2.4.9 vanilla:


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


1. Fix for vma merging refcounting bug

When a new vma can be merged simultaneously with its two immediate
neighbours in both directions, vma_merge() extends the predecessor vma
and deletes the successor.  However, if the vma maps a file, it fails to
fput() when doing the delete, leaving the file's refcount inconsistent.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#                  ChangeSet    1.1083  -> 1.1084
#                  mm/mmap.c    1.79    -> 1.80  
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------

# Fix vma merging problem leading to file refcount getting out of sync.
# --------------------------------------------
diff -Nru a/mm/mmap.c b/mm/mmap.c
--- a/mm/mmap.c Fri May  9 13:26:53 2003

                        if (need_up)
+                       if (file)
+                               fput(file);

                        kmem_cache_free(vm_area_cachep, next);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Anybody know how to make Intel Ether Express work?

3. VMA Merging

4. lp/jetadmin - I've done *something* stupid

5. Remove page_table_lock from vma manipulations

6., tcp 143

7. vma->vm_end > 0x60000000

8. Unix Tools (Again)

9. fix obj vma sorting

10. mremap corrupts freed vma

11. 2.4.9 VM/VMA subsystem works much better

12. Define flags for vma

13. vma->shared list_head initializations