]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: remove free_area_cache
authorMichel Lespinasse <walken@google.com>
Wed, 20 Mar 2013 04:07:28 +0000 (15:07 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Mar 2013 04:22:52 +0000 (15:22 +1100)
Since all architectures have been converted to use vm_unmapped_area(),
there is no remaining use for the free_area_cache.

Signed-off-by: Michel Lespinasse <walken@google.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
17 files changed:
arch/arm/mm/mmap.c
arch/arm64/mm/mmap.c
arch/mips/mm/mmap.c
arch/powerpc/mm/mmap_64.c
arch/s390/mm/mmap.c
arch/sparc/kernel/sys_sparc_64.c
arch/tile/mm/mmap.c
arch/x86/ia32/ia32_aout.c
arch/x86/mm/mmap.c
fs/binfmt_aout.c
fs/binfmt_elf.c
include/linux/mm_types.h
include/linux/sched.h
kernel/fork.c
mm/mmap.c
mm/nommu.c
mm/util.c

index 10062ceadd1cc40ca48cc59e83f2deb6fc3e07da..0c6356255fe31122f2527a0a2947439e69b0e953 100644 (file)
@@ -181,11 +181,9 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
        if (mmap_is_legacy()) {
                mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
                mm->get_unmapped_area = arch_get_unmapped_area;
-               mm->unmap_area = arch_unmap_area;
        } else {
                mm->mmap_base = mmap_base(random_factor);
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
-               mm->unmap_area = arch_unmap_area_topdown;
        }
 }
 
index 7c7be78556387ed548c3c37641cef3be9441ef5a..8ed6cb1a900f2981b85dfefa00d72ac023b38177 100644 (file)
@@ -90,11 +90,9 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
        if (mmap_is_legacy()) {
                mm->mmap_base = TASK_UNMAPPED_BASE;
                mm->get_unmapped_area = arch_get_unmapped_area;
-               mm->unmap_area = arch_unmap_area;
        } else {
                mm->mmap_base = mmap_base();
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
-               mm->unmap_area = arch_unmap_area_topdown;
        }
 }
 EXPORT_SYMBOL_GPL(arch_pick_mmap_layout);
index 7e5fe2790d8a212a8d0163989280918d26a46a3c..f1baadd56e82e2b0b4f2b79bd82686ea61a112d0 100644 (file)
@@ -158,11 +158,9 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
        if (mmap_is_legacy()) {
                mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
                mm->get_unmapped_area = arch_get_unmapped_area;
-               mm->unmap_area = arch_unmap_area;
        } else {
                mm->mmap_base = mmap_base(random_factor);
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
-               mm->unmap_area = arch_unmap_area_topdown;
        }
 }
 
index 67a42ed0d2fc8408c7ecb197a3c5bf58c5bee6df..cb8bdbe4972fa8bbe4c63039537ab9cbd4ccb233 100644 (file)
@@ -92,10 +92,8 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
        if (mmap_is_legacy()) {
                mm->mmap_base = TASK_UNMAPPED_BASE;
                mm->get_unmapped_area = arch_get_unmapped_area;
-               mm->unmap_area = arch_unmap_area;
        } else {
                mm->mmap_base = mmap_base();
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
-               mm->unmap_area = arch_unmap_area_topdown;
        }
 }
index 06bafec00278c654d616c731a2711a0b7b5beced..40023290ee5b43dea2cf72b68c97f9495b6c59fd 100644 (file)
@@ -91,11 +91,9 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
        if (mmap_is_legacy()) {
                mm->mmap_base = TASK_UNMAPPED_BASE;
                mm->get_unmapped_area = arch_get_unmapped_area;
-               mm->unmap_area = arch_unmap_area;
        } else {
                mm->mmap_base = mmap_base();
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
-               mm->unmap_area = arch_unmap_area_topdown;
        }
 }
 
@@ -176,11 +174,9 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
        if (mmap_is_legacy()) {
                mm->mmap_base = TASK_UNMAPPED_BASE;
                mm->get_unmapped_area = s390_get_unmapped_area;
-               mm->unmap_area = arch_unmap_area;
        } else {
                mm->mmap_base = mmap_base();
                mm->get_unmapped_area = s390_get_unmapped_area_topdown;
-               mm->unmap_area = arch_unmap_area_topdown;
        }
 }
 
index 2daaaa6eda234df1ed86702f58a1d6f607b35ff4..51561b8b15baf916f7d5cb5e5cc0db3d8eb6032f 100644 (file)
@@ -290,7 +290,6 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
            sysctl_legacy_va_layout) {
                mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
                mm->get_unmapped_area = arch_get_unmapped_area;
-               mm->unmap_area = arch_unmap_area;
        } else {
                /* We know it's 32-bit */
                unsigned long task_size = STACK_TOP32;
@@ -302,7 +301,6 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
 
                mm->mmap_base = PAGE_ALIGN(task_size - gap - random_factor);
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
-               mm->unmap_area = arch_unmap_area_topdown;
        }
 }
 
index f96f4cec602ad6bd3f15e2502f6b35ae369bd05f..d67d91ebf63e693e1562f2b465de5e69fe490547 100644 (file)
@@ -66,10 +66,8 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
        if (!is_32bit || rlimit(RLIMIT_STACK) == RLIM_INFINITY) {
                mm->mmap_base = TASK_UNMAPPED_BASE;
                mm->get_unmapped_area = arch_get_unmapped_area;
-               mm->unmap_area = arch_unmap_area;
        } else {
                mm->mmap_base = mmap_base(mm);
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
-               mm->unmap_area = arch_unmap_area_topdown;
        }
 }
index 03abf9b70011c288d362d1faa7ac67fe9c57f4ed..14fb6f9a73634213ad2684b8945e41d4d6ba0222 100644 (file)
@@ -309,8 +309,6 @@ static int load_aout_binary(struct linux_binprm *bprm)
                (current->mm->start_data = N_DATADDR(ex));
        current->mm->brk = ex.a_bss +
                (current->mm->start_brk = N_BSSADDR(ex));
-       current->mm->free_area_cache = TASK_UNMAPPED_BASE;
-       current->mm->cached_hole_size = 0;
 
        retval = setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT);
        if (retval < 0) {
index 845df6835f9ff5fc216ab01857100d41eba77fbf..62c29a5bfe26aeb67bf63fb545294b79765e445f 100644 (file)
@@ -115,10 +115,8 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
        if (mmap_is_legacy()) {
                mm->mmap_base = mmap_legacy_base();
                mm->get_unmapped_area = arch_get_unmapped_area;
-               mm->unmap_area = arch_unmap_area;
        } else {
                mm->mmap_base = mmap_base();
                mm->get_unmapped_area = arch_get_unmapped_area_topdown;
-               mm->unmap_area = arch_unmap_area_topdown;
        }
 }
index bbc8f8827eac6acef8254ace738230ae07043038..b370338190704d8036fc53394293dc073ee16472 100644 (file)
@@ -256,8 +256,6 @@ static int load_aout_binary(struct linux_binprm * bprm)
                (current->mm->start_data = N_DATADDR(ex));
        current->mm->brk = ex.a_bss +
                (current->mm->start_brk = N_BSSADDR(ex));
-       current->mm->free_area_cache = current->mm->mmap_base;
-       current->mm->cached_hole_size = 0;
 
        retval = setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT);
        if (retval < 0) {
index 3939829f6c5cc67e7d0ca1e9518f1df834be5088..355142bd4f60996b5deb19026ab6d8bc6bb8fe6f 100644 (file)
@@ -735,8 +735,6 @@ static int load_elf_binary(struct linux_binprm *bprm)
 
        /* Do this so that we can load the interpreter, if need be.  We will
           change some of these later */
-       current->mm->free_area_cache = current->mm->mmap_base;
-       current->mm->cached_hole_size = 0;
        retval = setup_arg_pages(bprm, randomize_stack_top(STACK_TOP),
                                 executable_stack);
        if (retval < 0) {
index ace9a5f01c64fe1a8ae9d97fe45765ddc375df58..fb425aa16c0149fdf35b9fe6a1be3a56577d3ff7 100644 (file)
@@ -330,12 +330,9 @@ struct mm_struct {
        unsigned long (*get_unmapped_area) (struct file *filp,
                                unsigned long addr, unsigned long len,
                                unsigned long pgoff, unsigned long flags);
-       void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
 #endif
        unsigned long mmap_base;                /* base of mmap area */
        unsigned long task_size;                /* size of task vm space */
-       unsigned long cached_hole_size;         /* if non-zero, the largest hole below free_area_cache */
-       unsigned long free_area_cache;          /* first hole of size cached_hole_size or larger */
        unsigned long highest_vm_end;           /* highest vma end address */
        pgd_t * pgd;
        atomic_t mm_users;                      /* How many users with user space? */
index be99a5ce1ac6a437dfb3f34c21623c2cbefb4983..a10fc539ad6245f325176a7cc474a73ae2294870 100644 (file)
@@ -324,8 +324,6 @@ extern unsigned long
 arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
                          unsigned long len, unsigned long pgoff,
                          unsigned long flags);
-extern void arch_unmap_area(struct mm_struct *, unsigned long);
-extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
 #else
 static inline void arch_pick_mmap_layout(struct mm_struct *mm) {}
 #endif
index 7d40687b14344a934437d91ae3a8be065980c466..e66be316ae0f05276001419654623e25ff5a3262 100644 (file)
@@ -364,8 +364,6 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
        mm->locked_vm = 0;
        mm->mmap = NULL;
        mm->mmap_cache = NULL;
-       mm->free_area_cache = oldmm->mmap_base;
-       mm->cached_hole_size = ~0UL;
        mm->map_count = 0;
        cpumask_clear(mm_cpumask(mm));
        mm->mm_rb = RB_ROOT;
@@ -539,8 +537,6 @@ static struct mm_struct *mm_init(struct mm_struct *mm, struct task_struct *p)
        mm->nr_ptes = 0;
        memset(&mm->rss_stat, 0, sizeof(mm->rss_stat));
        spin_lock_init(&mm->page_table_lock);
-       mm->free_area_cache = TASK_UNMAPPED_BASE;
-       mm->cached_hole_size = ~0UL;
        mm_init_aio(mm);
        mm_init_owner(mm, p);
 
index c7113d28d10555b2b6661f610f7ca7967d520e11..65e274a21a0d052ee61cabda7ad63a3bbcc7f75b 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1816,15 +1816,6 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
 }
 #endif 
 
-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)
-               mm->free_area_cache = addr;
-}
-
 /*
  * This mmap-allocator allocates new areas top-down from below the
  * stack's low limit (the base):
@@ -1881,19 +1872,6 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
 }
 #endif
 
-void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr)
-{
-       /*
-        * Is this a new hole at the highest possible address?
-        */
-       if (addr > mm->free_area_cache)
-               mm->free_area_cache = addr;
-
-       /* dont allow allocations above current base */
-       if (mm->free_area_cache > mm->mmap_base)
-               mm->free_area_cache = mm->mmap_base;
-}
-
 unsigned long
 get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
                unsigned long pgoff, unsigned long flags)
@@ -2314,7 +2292,6 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
 {
        struct vm_area_struct **insertion_point;
        struct vm_area_struct *tail_vma = NULL;
-       unsigned long addr;
 
        insertion_point = (prev ? &prev->vm_next : &mm->mmap);
        vma->vm_prev = NULL;
@@ -2331,11 +2308,6 @@ detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma,
        } else
                mm->highest_vm_end = prev ? prev->vm_end : 0;
        tail_vma->vm_next = NULL;
-       if (mm->unmap_area == arch_unmap_area)
-               addr = prev ? prev->vm_end : mm->mmap_base;
-       else
-               addr = vma ?  vma->vm_start : mm->mmap_base;
-       mm->unmap_area(mm, addr);
        mm->mmap_cache = NULL;          /* Kill the cache. */
 }
 
index bdeea9627aab0331357849285156c44e22c86221..3cc034cc122cf10b9e380009fb40b5b26f9c81a3 100644 (file)
@@ -1857,10 +1857,6 @@ unsigned long arch_get_unmapped_area(struct file *file, unsigned long addr,
        return -ENOMEM;
 }
 
-void arch_unmap_area(struct mm_struct *mm, unsigned long addr)
-{
-}
-
 void unmap_mapping_range(struct address_space *mapping,
                         loff_t const holebegin, loff_t const holelen,
                         int even_cows)
index ab1424dbe2e6c9396ee66ab4446f1bc1cd557382..7441c41d00f64df8b2f2439d3bce661cc12c1966 100644 (file)
--- a/mm/util.c
+++ b/mm/util.c
@@ -295,7 +295,6 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
 {
        mm->mmap_base = TASK_UNMAPPED_BASE;
        mm->get_unmapped_area = arch_get_unmapped_area;
-       mm->unmap_area = arch_unmap_area;
 }
 #endif