mm: remove unnecessary write to vma iterator in __vma_adjust()
If the vma start address is going to change due to an insert, then it is safe to not write the vma to the tree. The write of the insert vma will alter the tree as necessary. Link: https://lkml.kernel.org/r/20230120162650.984577-35-Liam.Howlett@oracle.com Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Родитель
85ab779e34
Коммит
c465be97a4
10
mm/mmap.c
10
mm/mmap.c
|
@ -719,10 +719,12 @@ int __vma_adjust(struct vma_iterator *vmi, struct vm_area_struct *vma,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start != vma->vm_start) {
|
if (start != vma->vm_start) {
|
||||||
if ((vma->vm_start < start) &&
|
if (vma->vm_start < start) {
|
||||||
(!insert || (insert->vm_end != start))) {
|
if (!insert || (insert->vm_end != start)) {
|
||||||
vma_iter_clear(vmi, vma->vm_start, start);
|
vma_iter_clear(vmi, vma->vm_start, start);
|
||||||
VM_WARN_ON(insert && insert->vm_start > vma->vm_start);
|
vma_iter_set(vmi, start);
|
||||||
|
VM_WARN_ON(insert && insert->vm_start > vma->vm_start);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
vma_changed = true;
|
vma_changed = true;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче