From: Liam R. Howlett Date: Tue, 23 Feb 2021 16:35:27 +0000 (-0500) Subject: nommu: remove cache X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f04259e3a7483f091a9024d4b320674cdfe743f7;p=users%2Fjedix%2Flinux-maple.git nommu: remove cache Signed-off-by: Liam R. Howlett --- diff --git a/mm/nommu.c b/mm/nommu.c index 98be7864a195..17f8b9233bdc 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -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);