Re: [PATCH v3 04/18] mm/huge_memory: split the routine for splitting anon and file folio
From: Kairui Song
Date: Thu Aug 27 2026 - 13:23:13 EST
On Thu, Aug 27, 2026 at 10:58 PM Kiryl Shutsemau <kirill@xxxxxxxxxxxxx> wrote:
>
> On Fri, Aug 21, 2026 at 02:55:17AM +0800, Kairui Song via B4 Relay wrote:
> > @@ -4064,7 +4095,6 @@ static int __folio_freeze_and_split_unmapped(struct folio *folio, unsigned int n
> > folio_put_refs(new_folio, nr_pages);
> > }
> >
> > - zone_device_private_split_cb(folio, NULL);
> > /*
> > * Unfreeze @folio only after all page cache entries, which
> > * used to point to it, have been updated with new folios.
>
> This gave me a pause.
>
> I don't know much about the zone device private thing and I had to dig
> to check if such folios are always anon. They are. But it is not obvious
> to me why this limitation could not be lifted tomorrow. Nothing in "not
> directly addressable by the CPU" implies anon-only.
>
> I would appreciate some explanation in the commit message and maybe
> VM_WARN_ON_ONCE_FOLIO(folio_is_device_private(folio), folio) in the file
> path to flag surprises.
Right, good idea. A sanity check and some comments are better, will add these.
Currently device private folios are always anon and never even in
swapcache, many comments and sanity checks in migrate_device.c implies
that.