Re: [PATCH v2 2/4] mm/huge_memory: replace can_split_folio() with direct refcount calculation

From: Wei Yang

Date: Sat Nov 22 2025 - 20:51:12 EST


On Fri, Nov 21, 2025 at 09:55:27PM -0500, Zi Yan wrote:
>can_split_folio() is just a refcount comparison, making sure only the
>split caller holds an extra pin. Open code it with
>folio_expected_ref_count() != folio_ref_count() - 1. For the extra_pins
>used by folio_ref_freeze(), add folio_cache_references() to calculate it.
>
>Suggested-by: David Hildenbrand (Red Hat) <david@xxxxxxxxxx>
>Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>

LGTM, Thanks

Reviewed-by: Wei Yang <richard.weiyang@xxxxxxxxx>

--
Wei Yang
Help you, Help me