Re: [PATCH 5/5] mm: support choosing to do THP COW for anonymous pmd entry.

From: David Hildenbrand (Arm)

Date: Fri May 01 2026 - 03:12:04 EST



> - /*
> - * See do_wp_page(): we can only reuse the folio exclusively if
> - * there are no additional references. Note that we always drain
> - * the LRU cache immediately after adding a THP.
> - */
> - if (folio_ref_count(folio) >
> - 1 + folio_test_swapcache(folio) * folio_nr_pages(folio))
> - goto unlock_fallback;
> if (folio_test_swapcache(folio))

I don't see why you would want to remove this check, really. Instead of
"fallback", you might want to try copying the PMD.

--
Cheers,

David