mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
msm: kgsl: Skip the intersecting vma
If we intersect with an existing vma, we check against the same vma multiple times which causes huge latency during mmap. So check against an existing vma just once and move on. Change-Id: Ib7975493d137f29db7ce01fc1d0ac7d88b9405e2 Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
This commit is contained in:
parent
137a997bae
commit
0ca862d2bb
1 changed files with 11 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2008-2019, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2008-2020, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <uapi/linux/sched/types.h>
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
#include <linux/io.h>
|
||||
#include <linux/ion.h>
|
||||
#include <linux/mman.h>
|
||||
#include <linux/mm_types.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_fdt.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
|
@ -4519,10 +4520,6 @@ static unsigned long set_svm_area(struct file *file,
|
|||
struct kgsl_process_private *private = dev_priv->process_priv;
|
||||
unsigned long ret;
|
||||
|
||||
/* Make sure there isn't a vma conflict in the chosen range */
|
||||
if (find_vma_intersection(current->mm, addr, addr + len - 1))
|
||||
return -ENOMEM;
|
||||
|
||||
/*
|
||||
* Do additoinal constraints checking on the address. Passing MAP_FIXED
|
||||
* ensures that the address we want gets checked
|
||||
|
|
@ -4547,6 +4544,7 @@ static unsigned long get_svm_unmapped_area(struct file *file,
|
|||
unsigned long align = get_align(entry);
|
||||
unsigned long ret, iova;
|
||||
u64 start = 0, end = 0;
|
||||
struct vm_area_struct *vma;
|
||||
|
||||
if (flags & MAP_FIXED) {
|
||||
/* Even fixed addresses need to obey alignment */
|
||||
|
|
@ -4575,9 +4573,14 @@ static unsigned long get_svm_unmapped_area(struct file *file,
|
|||
len, align);
|
||||
|
||||
while (!IS_ERR_VALUE(iova)) {
|
||||
ret = set_svm_area(file, entry, iova, len, flags);
|
||||
if (!IS_ERR_VALUE(ret))
|
||||
return ret;
|
||||
vma = find_vma_intersection(current->mm, iova, iova + len - 1);
|
||||
if (vma) {
|
||||
iova = vma->vm_start;
|
||||
} else {
|
||||
ret = set_svm_area(file, entry, iova, len, flags);
|
||||
if (!IS_ERR_VALUE(ret))
|
||||
return ret;
|
||||
}
|
||||
|
||||
iova = kgsl_mmu_find_svm_region(private->pagetable,
|
||||
start, iova - 1, len, align);
|
||||
|
|
|
|||
Loading…
Reference in a new issue