Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/vma: use unmap_region() in vms_clear_ptes()

There is no need to open code the vms_clear_ptes() now that unmap_desc
struct is used.

Link: https://lkml.kernel.org/r/20260121164946.2093480-11-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Chris Li <chrisl@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jann Horn <jannh@google.com>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: SeongJae Park <sj@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Liam R. Howlett and committed by
Andrew Morton
2314fe9b 0df5a8d3

+1 -13
+1 -13
mm/vma.c
··· 1255 1255 static inline void vms_clear_ptes(struct vma_munmap_struct *vms, 1256 1256 struct ma_state *mas_detach, bool mm_wr_locked) 1257 1257 { 1258 - struct mmu_gather tlb; 1259 1258 struct unmap_desc unmap = { 1260 1259 .mas = mas_detach, 1261 1260 .first = vms->vma, ··· 1279 1280 if (!vms->clear_ptes) /* Nothing to do */ 1280 1281 return; 1281 1282 1282 - /* 1283 - * We can free page tables without write-locking mmap_lock because VMAs 1284 - * were isolated before we downgraded mmap_lock. 1285 - */ 1286 1283 mas_set(mas_detach, 1); 1287 - tlb_gather_mmu(&tlb, vms->vma->vm_mm); 1288 - update_hiwater_rss(vms->vma->vm_mm); 1289 - unmap_vmas(&tlb, &unmap); 1290 - mas_set(mas_detach, 1); 1291 - /* start and end may be different if there is no prev or next vma. */ 1292 - free_pgtables(&tlb, mas_detach, vms->vma, vms->unmap_start, 1293 - vms->unmap_end, vms->unmap_end, mm_wr_locked); 1294 - tlb_finish_mmu(&tlb); 1284 + unmap_region(&unmap); 1295 1285 vms->clear_ptes = false; 1296 1286 } 1297 1287