Revert "ANDROID: Use the notifier lock to perform file-backed vma teardown"

This reverts commit dc8ac508af.
Reason for revert: performance regression.

Bug: 234527424
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I5811c7ee2feac7f9057ed0ccd848e5de71f79354
This commit is contained in:
Suren Baghdasaryan 2022-06-08 08:28:22 -07:00 committed by Carlos Llamas
parent f25e13c1bc
commit a16e169d36
2 changed files with 3 additions and 16 deletions

View File

@ -402,13 +402,6 @@ void vm_area_free(struct vm_area_struct *vma)
free_anon_vma_name(vma);
#ifdef CONFIG_SPECULATIVE_PAGE_FAULT
if (atomic_read(&vma->vm_mm->mm_users) > 1) {
if (vma->vm_file) {
struct mm_struct *mm = vma->vm_mm;
percpu_down_write(mm->mmu_notifier_lock);
____vm_area_free(vma);
percpu_up_write(mm->mmu_notifier_lock);
return;
}
call_rcu(&vma->vm_rcu, __vm_area_free);
return;
}

View File

@ -3988,16 +3988,10 @@ static vm_fault_t __do_fault(struct vm_fault *vmf)
/*
* The mmap sequence count check guarantees that the
* vma we fetched at the start of the fault was still
* current at that point in time. The notifier lock
* ensures vmf->vma->vm_file stays valid. vma is
* stable because we are operating on a copy made at
* the start of the fault.
* current at that point in time. The rcu read lock
* ensures vmf->vma->vm_file stays valid.
*/
if (mmu_notifier_trylock(vmf->vma->vm_mm)) {
ret = vma->vm_ops->fault(vmf);
mmu_notifier_unlock(vmf->vma->vm_mm);
} else
ret = VM_FAULT_RETRY;
ret = vma->vm_ops->fault(vmf);
}
rcu_read_unlock();
} else