Re: [PATCH 0/3] Batch unmap of uffd-wp file folios
From: Andrew Morton
Date: Wed Jul 15 2026 - 15:01:44 EST
On Wed, 15 Jul 2026 11:18:33 +0000 Dev Jain <dev.jain@xxxxxxx> wrote:
> Currently, batched unmapping is supported if:
>
> 1) folio is a file folio, not belonging to uffd-wp VMA
> 2) folio is anonymous and not swapbacked (lazyfree), not belonging to
> uffd-wp VMA
>
> So the cases which are not supported are
>
> 1) folio belonging to uffd-wp VMA
> 2) folio is anonymous and swapbacked
>
> It is easy to see that this adds a lot of cognitive load while reading
> try_to_unmap_one - we need to remember throughout whether nr_pages == 1
> or > 1.
>
> The uffd-wp handling in try_to_unmap_one is regarding preserving the
> uffd-wp state for file folios via pte_install_uffd_wp_if_needed (for anon
> folio, we handle that while constructing the swap pte).
>
> Stop special casing on uffd-wp VMAs by simply adding batching support
> to pte_install_uffd_wp_if_needed.
Thanks, I'll await reviewer input on this.
Sashiko might have found a pre-existing issue:
https://sashiko.dev/#/patchset/20260715111839.1667914-1-dev.jain@xxxxxxx