On 1/9/26 14:19, David Hildenbrand (Red Hat) wrote:
On 1/9/26 09:54, Francois Dugast wrote:
From: Matthew Brost <[email protected]>
Add folio_split_unref helper which splits an unreferenced folio
split_unref reads like "split and unref".
You probably want to call this something like "folio_split_frozen" ?
The very definition of "frozen" is "refcount = 0 ", so you can simplify
the documentation.
Are the folios you want to pass in there completely unused (-> free) or
might they still be in use (e.g., migration entries point at them during
folio split)
So I am not sure yet if this should be "folio_split_frozen()" or
"folio_split_freed()" or sth like that.
I'm not CCed on the other patches in the series or the cover letter, so
I don't see the context.
Ah, I was CCed on #3 where we call this function on folios that are
getting freed.
In that case it would be acceptable to initialize folio->mapping (and
folio->index?) of the split folios. Do we also have to initialize
folio->flags, folio->private etc?
See __split_huge_page_tail().
folio_split_freed() would likely be best, because then it is clearer
that there is absolutely no state to copy from the large folio.
You should describe in this patch here in which context the function is
supposed to be used in later commits.
--
Cheers
David