Re: [PATCH v4 04/17] mm/huge_memory: split the routine for splitting anon and file folio

From: Kiryl Shutsemau

Date: Tue Sep 08 2026 - 11:39:15 EST


On Tue, Sep 08, 2026 at 02:12:08AM +0800, Kairui Song via B4 Relay wrote:
> From: Kairui Song <kasong@xxxxxxxxxxx>
>
> No functional change intended. Before adding more logic, split
> __folio_freeze_and_split_unmapped() into an anon and a file variant so
> each path can evolve independently. The two paths shared little beyond
> the folio freeze call, the LRU locking, and the unfreeze skeleton, but
> differed in all other per-folio bookkeeping and routines.
>
> While splitting, some cleanups become easy to apply, and helped drop a
> few now-redundant checks.
>
> The zone_device_private_split_cb() calls are only kept in the anon
> variant, as device private folios can only back anonymous memory, and
> add a VM_WARN_ON_ONCE_FOLIO() at the entry of the file variant.
>
> Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
> Reviewed-by: Yeoreum Yun <yeoreum.yun@xxxxxxx>
> Signed-off-by: Kairui Song <kasong@xxxxxxxxxxx>

Reviewed-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>

--
Kiryl Shutsemau / Kirill A. Shutemov