Re: [PATCH] mm/huge_memory: add folio_reset_partially_mapped()

From: Kiryl Shutsemau

Date: Tue Sep 08 2026 - 09:39:32 EST


On Tue, Sep 08, 2026 at 10:25:07AM +0100, Lorenzo Stoakes (ARM) wrote:
> On Mon, Sep 07, 2026 at 07:33:40PM +0100, Kiryl Shutsemau wrote:
> > Suggested-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> > Assisted-by: Claude-Code:claude-fable-5-1
>
> Note that policy has changed on Assisted-by tags so this should be:
>
> Assisted-by: LLM

I was not aware. Thanks.

Will fix in v2.

> > +static void folio_reset_partially_mapped(struct folio *folio)
> > +{
> > + VM_WARN_ON_FOLIO(folio_ref_count(folio), folio);
>
> NIT: I wonder if we could have a folio_is_frozen() that'd make this
> self-documenting? As trivial as it'd be :)
>
> If not, then a comment like:
>
> /* Folio must be frozen. */
>
> Would be helpful.

There is a series that changes how frozen is encoded and would be the
natural home for such a helper:

https://lore.kernel.org/all/bb1cb750157733f897df2e261cad3d5c42acc172@xxxxxxxxx/

The patchset seems to be stuck. Not sure what the plan there. Ilya?

I will go with the comment for v2.

--
Kiryl Shutsemau / Kirill A. Shutemov