Re: [PATCH v5 05/17] mm/hugetlb: use direct assignment instead of folio_change_private()

From: Lance Yang

Date: Mon Sep 21 2026 - 03:13:17 EST




On 2026/9/21 10:28, Zi Yan wrote:
folio_change_private() should be used along with folio_attach_private() and
folio_detach_private(), where adding and remove ->private content requires
folio refcount change. add_hugetlb_folio() simply sets folio->private to
NULL without refcount manipulation. Change it to direct assignment to avoid
semantic confusion.

It prepares for a future commit that remove PG_private.

No functional change intended.

Assisted-by: LLM
To: Muchun Song <muchun.song@xxxxxxxxx>
To: Oscar Salvador <osalvador@xxxxxxx>
To: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: David Hildenbrand <david@xxxxxxxxxx>
Cc: linux-mm@xxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Acked-by: Usama Arif <usama.arif@xxxxxxxxx>
Reviewed-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
Reviewed-by: Muchun Song <muchun.song@xxxxxxxxx>
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
---

Nice cleanup! Feel free to add:

Reviewed-by: Lance Yang <lance.yang@xxxxxxxxx>