Re: [PATCH v4 00/12] Optimize anonymous large folio unmapping
From: Dev Jain
Date: Thu May 28 2026 - 12:57:11 EST
Sashiko:
Patch 9:
About anon-exclusivity: At this point, the batched helper is not
called with nr_pages > 1. Later, anon-exclusive uniformity is
handled.
On PUD folio: that is never passed to folio_try_share_anon_rmap.
I was following the pattern followed elsewhere, given that
PUD THP is not supported yet. Although there is no harm in
changing the check to (level != PGTABLE_LEVEL_PTE).
On hugetlb folio: that is never passed.
Patch 11:
Existing bug: doesn't look like it. uffd-wp is not there for
a migration-writable softleaf entry.
Patch 12:
ABout sparc64: Yep I'll change this to #ifdef or something. Apparently
is_defined() doesn't work in case the macro doesn't have a value.
About dirty young and uffd-wp bits: we don't care about dirty and young
bits since we are converting to swap ptes. uff-wp uniformity is preserved
through folio_pte_batch.
About stale nr_pages: The patch initializing nr_pages = 1 at the start of
the loop is already in mm-hotfixes.
About O(N): Yes I will update this to retain the nr_pages == folio_nr_pages()
early bail out.