vma.c (9c3ebeda8fb5a8e9e82ab9364ec3d4b80cd0ec3d) vma.c (94f59ea591f17d5fb77f68e820b27522596a7e9e)
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3/*
4 * VMA-specific functions.
5 */
6
7#include "vma_internal.h"
8#include "vma.h"

--- 141 unchanged lines hidden (view full) ---

150 vm_area_free(vma);
151}
152
153/*
154 * Get rid of page table information in the indicated region.
155 *
156 * Called with the mm semaphore held.
157 */
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3/*
4 * VMA-specific functions.
5 */
6
7#include "vma_internal.h"
8#include "vma.h"

--- 141 unchanged lines hidden (view full) ---

150 vm_area_free(vma);
151}
152
153/*
154 * Get rid of page table information in the indicated region.
155 *
156 * Called with the mm semaphore held.
157 */
158void unmap_region(struct mm_struct *mm, struct ma_state *mas,
159 struct vm_area_struct *vma, struct vm_area_struct *prev,
160 struct vm_area_struct *next, unsigned long start,
161 unsigned long end, unsigned long tree_end, bool mm_wr_locked)
158void unmap_region(struct ma_state *mas, struct vm_area_struct *vma,
159 struct vm_area_struct *prev, struct vm_area_struct *next)
162{
160{
161 struct mm_struct *mm = vma->vm_mm;
163 struct mmu_gather tlb;
162 struct mmu_gather tlb;
164 unsigned long mt_start = mas->index;
165
166 lru_add_drain();
167 tlb_gather_mmu(&tlb, mm);
168 update_hiwater_rss(mm);
163
164 lru_add_drain();
165 tlb_gather_mmu(&tlb, mm);
166 update_hiwater_rss(mm);
169 unmap_vmas(&tlb, mas, vma, start, end, tree_end, mm_wr_locked);
170 mas_set(mas, mt_start);
167 unmap_vmas(&tlb, mas, vma, vma->vm_start, vma->vm_end, vma->vm_end,
168 /* mm_wr_locked = */ true);
169 mas_set(mas, vma->vm_end);
171 free_pgtables(&tlb, mas, vma, prev ? prev->vm_end : FIRST_USER_ADDRESS,
170 free_pgtables(&tlb, mas, vma, prev ? prev->vm_end : FIRST_USER_ADDRESS,
172 next ? next->vm_start : USER_PGTABLES_CEILING,
173 mm_wr_locked);
171 next ? next->vm_start : USER_PGTABLES_CEILING,
172 /* mm_wr_locked = */ true);
174 tlb_finish_mmu(&tlb);
175}
176
177/*
178 * __split_vma() bypasses sysctl_max_map_count checking. We use this where it
179 * has already been checked or doesn't make sense to fail.
180 * VMA Iterator will point to the original VMA.
181 */

--- 1649 unchanged lines hidden ---
173 tlb_finish_mmu(&tlb);
174}
175
176/*
177 * __split_vma() bypasses sysctl_max_map_count checking. We use this where it
178 * has already been checked or doesn't make sense to fail.
179 * VMA Iterator will point to the original VMA.
180 */

--- 1649 unchanged lines hidden ---