Skip to contentSkip to conversation

mm-hugetlb-use-direct-assignment-instead-of-folio_change_private.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 9

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/hugetlb: use direct assignment instead of folio_change_private()
has been removed from the -mm tree. Its filename was
mm-hugetlb-use-direct-assignment-instead-of-folio_change_private.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Zi Yan <[email protected]>
Subject: mm/hugetlb: use direct assignment instead of folio_change_private()
Date: Sun, 20 Sep 2026 22:28:01 -0400

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.

---

 mm/hugetlb.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
mm/hugetlb.c renamed from mm/hugetlb.c~mm-hugetlb-use-direct-assignment-instead-of-folio_change_private +2 -5
@@ -1446,11 +1446,8 @@ void add_hugetlb_folio(struct hstate *h,
 	}
 
 	__folio_set_hugetlb(folio);
-	folio_change_private(folio, NULL);
-	/*
-	 * We have to set hugetlb_vmemmap_optimized again as above
-	 * folio_change_private(folio, NULL) cleared it.
-	 */
+	/* Clear all folio->private flags except hugetlb_vmemmap_optimized. */
+	folio->private = NULL;
 	folio_set_hugetlb_vmemmap_optimized(folio);
 
 	arch_clear_hugetlb_flags(folio);

_

Patches currently in -mm which might be from [email protected] are