]> Git Repo - linux.git/commitdiff
mm: do not reset cached_hole_size when vma is unmapped
authorXiao Guangrong <[email protected]>
Wed, 21 Mar 2012 23:33:56 +0000 (16:33 -0700)
committerLinus Torvalds <[email protected]>
Thu, 22 Mar 2012 00:54:56 +0000 (17:54 -0700)
In the current code, cached_hole_size is set to the maximum value if the
unmapped vma is less that free_area_cache so the next search will search
from the base address.

Actually, we can keep cached_hole_size so that if the next required size
is more than cached_hole_size, it can search from free_area_cache.

Signed-off-by: Xiao Guangrong <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Hillf Danton <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: KAMEZAWA Hiroyuki <[email protected]>
Cc: Rik van Riel <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/mmap.c

index da15a79b1441b665b0e4b962eea38a92407018fd..4f31764d838f42d7c9e1561be097afc5dcf7fb44 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1426,10 +1426,8 @@ void arch_unmap_area(struct mm_struct *mm, unsigned long addr)
        /*
         * Is this a new hole at the lowest possible address?
         */
-       if (addr >= TASK_UNMAPPED_BASE && addr < mm->free_area_cache) {
+       if (addr >= TASK_UNMAPPED_BASE && addr < mm->free_area_cache)
                mm->free_area_cache = addr;
-               mm->cached_hole_size = ~0UL;
-       }
 }
 
 /*
This page took 0.064144 seconds and 4 git commands to generate.