]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
nommu: remove cache
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 23 Feb 2021 16:35:27 +0000 (11:35 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 23 Feb 2021 16:36:37 +0000 (11:36 -0500)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/nommu.c

index 98be7864a195db8d4bf018cefe6f388617130838..17f8b9233bdc50e51f2f2554eb428d76c0916460 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/export.h>
 #include <linux/mm.h>
 #include <linux/sched/mm.h>
-#include <linux/vmacache.h>
 #include <linux/mman.h>
 #include <linux/swap.h>
 #include <linux/file.h>
@@ -591,31 +590,9 @@ static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma)
  */
 static void delete_vma_from_mm(struct vm_area_struct *vma)
 {
-       int i;
-       struct address_space *mapping;
-       struct mm_struct *mm = vma->vm_mm;
-       struct task_struct *curr = current;
        MA_STATE(mas, &vma->vm_mm->mm_mt, 0, 0);
 
-       mm->map_count--;
-       for (i = 0; i < VMACACHE_SIZE; i++) {
-               /* if the vma is cached, invalidate the entire cache */
-               if (curr->vmacache.vmas[i] == vma) {
-                       vmacache_invalidate(mm);
-                       break;
-               }
-       }
-       /* remove the VMA from the mapping */
-       if (vma->vm_file) {
-               mapping = vma->vm_file->f_mapping;
-
-               i_mmap_lock_write(mapping);
-               flush_dcache_mmap_lock(mapping);
-               vma_interval_tree_remove(vma, &mapping->i_mmap);
-               flush_dcache_mmap_unlock(mapping);
-               i_mmap_unlock_write(mapping);
-       }
-
+       vma->vm_mm->map_count--;
        vma_mas_remove(vma, &mas);
 }
 
@@ -641,18 +618,10 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
        struct vm_area_struct *vma;
        MA_STATE(mas, &mm->mm_mt, addr, addr);
 
-       /* check the cache first */
-       vma = vmacache_find(mm, addr);
-       if (likely(vma))
-               return vma;
-
        rcu_read_lock();
        vma = mas_walk(&mas);
        rcu_read_unlock();
 
-       if (vma)
-               vmacache_update(addr, vma);
-
        return vma;
 }
 EXPORT_SYMBOL(find_vma);