mm-memory-use-__zap_vma_range-in-zap_vma_for_reaping.patch removed from -mm tree
The quilt patch titled
Subject: mm/memory: use __zap_vma_range() in zap_vma_for_reaping()
has been removed from the -mm tree. Its filename was
mm-memory-use-__zap_vma_range-in-zap_vma_for_reaping.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: "David Hildenbrand (Arm)" <[email protected]>
Subject: mm/memory: use __zap_vma_range() in zap_vma_for_reaping()
Date: Fri, 27 Feb 2026 21:08:41 +0100
Let's call __zap_vma_range() instead of unmap_page_range() to prepare for further cleanups.
To keep the existing behavior, whereby we do not call uprobe_munmap() which could block, add a new "reaping" member to zap_details and use it.
Likely we should handle the possible blocking in uprobe_munmap() differently, but for now keep it unchanged.
---
include/linux/mm.h | 1 + mm/memory.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-memory-use-__zap_vma_range-in-zap_vma_for_reaping +1 -0
@@ -2769,6 +2769,7 @@ struct zap_details {struct folio *single_folio;/* Locked folio to be unmapped */ bool skip_cows;/* Do not zap COWed private pages */ bool reclaim_pt;/* Need reclaim page tables? */ +bool reaping;/* Reaping, do not block. */ zap_flags_t zap_flags;/* Extra flags for zapping */ };
mm/memory.c renamed from mm/memory.c~mm-memory-use-__zap_vma_range-in-zap_vma_for_reaping +9 -4
@@ -2079,14 +2079,18 @@ static void __zap_vma_range(struct mmu_g unsigned long start, unsigned long end, struct zap_details *details) { + const bool reaping = details && details->reaping; +VM_WARN_ON_ONCE (start >= end || !range_in_vma (vma, start, end)); -if (vma->vm_file) +/* uprobe_munmap() might sleep, so skip it when reaping. */ +if (vma->vm_file && !reaping)uprobe_munmap (vma, start, end);if (unlikely (is_vm_hugetlb_page (vma))) {zap_flags_t zap_flags = details ? details->zap_flags :0 ; +VM_WARN_ON_ONCE (reaping);/* * vm_file will be NULL when we fail early while instantiating * a new mapping. In this case, no pages were mapped yet and
@@ -2111,11 +2115,12 @@ static void __zap_vma_range(struct mmu_g*/ int zap_vma_for_reaping (struct vm_area_struct *vma) { +struct zap_details details = { + .reaping = true, + };struct mmu_notifier_range range;struct mmu_gather tlb; -VM_WARN_ON_ONCE (is_vm_hugetlb_page (vma)); -mmu_notifier_range_init (&range,MMU_NOTIFY_CLEAR ,0 , vma->vm_mm, vma->vm_start, vma->vm_end);tlb_gather_mmu (&tlb, vma->vm_mm);
@@ -2123,7 +2128,7 @@ int zap_vma_for_reaping(struct vm_area_stlb_finish_mmu (&tlb);return -EBUSY ; } -unmap_page_range (&tlb, vma, range.start, range.end,NULL ); +__zap_vma_range (&tlb, vma, range.start, range.end, &details);mmu_notifier_invalidate_range_end (&range);tlb_finish_mmu (&tlb);return 0 ;
_
Patches currently in -mm which might be from [email protected] are