[merged mm-stable] mm-rmap-batch-unmap-file-folios-belonging-to-uffd-wp-vmas.patch removed from -mm tree
Andrew Morton <[email protected]>
| Newsgroups | org.kernel.vger.mm-commits |
|---|---|
| Message-ID | <[email protected]> |
The quilt patch titled
Subject: mm/rmap: batch unmap file folios belonging to uffd-wp VMAs
has been removed from the -mm tree. Its filename was
mm-rmap-batch-unmap-file-folios-belonging-to-uffd-wp-vmas.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: Dev Jain <[email protected]>
Subject: mm/rmap: batch unmap file folios belonging to uffd-wp VMAs
Date: Mon, 20 Jul 2026 06:55:07 +0000
Commit a67fe41e214f ("mm: rmap: support batched unmapping for file large
folios") extended batched unmapping for file folios. That also required
making pte_install_uffd_wp_if_needed() support batching, but that was left
out for the time being. Correctness was maintained by stopping batching
if the VMA the folio belongs to is marked uffd-wp.
Now that cond_install_uffd_wp_ptes() supports batching, call it with the
full batch length and allow folio_unmap_pte_batch() to batch file folios
belonging to uffd-wp VMAs.
For file folios, if the uffd-wp bit is set, unmapping converts present
PTEs into uffd-wp markers. We must ensure that the same PTE range is not
reprocessed by the try_to_unmap_one() loop.
The page_vma_mapped_walk API ensures this: check_pte() only returns true
if any PFN in [pvmw->pfn, pvmw->pfn + nr_pages) is mapped by the PTE.
There is no PFN underlying a uffd-wp marker PTE, so check_pte() returns
false and the walk skips ahead until it reaches a present entry again.
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Dev Jain <[email protected]>
Acked-by: David Hildenbrand (Arm) <[email protected]>
Cc: Anshuman Khandual <[email protected]>
Cc: Axel Rasmussen <[email protected]>
Cc: Barry Song <[email protected]>
Cc: Harry Yoo <[email protected]>
Cc: Jann Horn <[email protected]>
Cc: Kairui Song <[email protected]>
Cc: Lance Yang <[email protected]>
Cc: Liam R. Howlett <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Ryan Roberts <[email protected]>
Cc: Shakeel Butt <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Wei Xu <[email protected]>
Cc: Yuanchu Xie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---
mm/rmap.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/mm/rmap.c~mm-rmap-batch-unmap-file-folios-belonging-to-uffd-wp-vmas
+++ a/mm/rmap.c
@@ -1965,9 +1965,6 @@ static inline unsigned int folio_unmap_p
if (pte_unused(pte))
return 1;
- if (userfaultfd_protected(vma))
- return 1;
-
/*
* If unmap fails, we need to restore the ptes. To avoid accidentally
* upgrading write permissions for ptes that were not originally
@@ -2345,7 +2342,8 @@ static bool try_to_unmap_one(struct foli
* we may want to replace a none pte with a marker pte if
* it's file-backed, so we don't lose the tracking info.
*/
- cond_install_uffd_wp_ptes(vma, address, pvmw.pte, pteval, 1);
+ cond_install_uffd_wp_ptes(vma, address, pvmw.pte, pteval,
+ nr_pages);
/* Update high watermark before we lower rss */
update_hiwater_rss(mm);
_
Patches currently in -mm which might be from [email protected] are