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

David Hildenbrand (Arm)
2026-05-01T07:11:54Z

> - /*
> - * 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