userfaultfd-introduce-vm_uffd_ops-alloc_folio.patch removed from -mm tree
The quilt patch titled
Subject: userfaultfd: introduce vm_uffd_ops->alloc_folio()
has been removed from the -mm tree. Its filename was
userfaultfd-introduce-vm_uffd_ops-alloc_folio.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: "Mike Rapoport (Microsoft)" <[email protected]>
Subject: userfaultfd: introduce vm_uffd_ops->alloc_folio()
Date: Thu, 2 Apr 2026 07:11:50 +0300
and use it to refactor mfill_atomic_pte_zeroed_folio() and mfill_atomic_pte_copy().
mfill_atomic_pte_zeroed_folio() and mfill_atomic_pte_copy() perform almost identical actions:
* allocate a folio
* update folio contents (either copy from userspace of fill with zeros)
* update page tables with the new folio
Split a __mfill_atomic_pte() helper that handles both cases and uses newly introduced vm_uffd_ops->alloc_folio() to allocate the folio.
Pass the ops structure from the callers to __mfill_atomic_pte() to later allow using anon_uffd_ops for MAP_PRIVATE mappings of file-backed VMAs.
Note, that the new ops method is called alloc_folio() rather than folio_alloc() to avoid clash with alloc_tag macro folio_alloc().
---
include/linux/userfaultfd_k.h | 6 ++ mm/userfaultfd.c | 92 ++++++++++++++++---------------- 2 files changed, 54 insertions(+), 44 deletions(-)
include/linux/userfaultfd_k.h renamed from include/linux/userfaultfd_k.h~userfaultfd-introduce-vm_uffd_ops-alloc_folio +6 -0
@@ -94,6 +94,12 @@ struct vm_uffd_ops {* The returned folio is locked and with reference held. */ struct folio *(*get_folio_noalloc)(struct inode *inode,pgoff_t pgoff); +/* +* Called during resolution of UFFDIO_COPY request. +* Should allocate and return a folio or NULL if allocation fails. +*/ +struct folio *(*alloc_folio)(struct vm_area_struct *vma, +unsigned long addr); };/* A combined operation mode + behavior flags. */
mm/userfaultfd.c renamed from mm/userfaultfd.c~userfaultfd-introduce-vm_uffd_ops-alloc_folio +48 -44
142 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are