[PATCH v6 17/17] mm/huge_memory: drop the redundant mapping argument of __split_frozen_folio
From: Kairui Song via B4 Relay
Date: Wed Sep 23 2026 - 17:34:29 EST
From: Kairui Song <kasong@xxxxxxxxxxx>
The mapping parameter only served as a non-NULL check to detect
whether page cache entries need updating. The xa_state pointer
conveys exactly the same information: the anon split helper passes
NULL and the file split helper passes &xas, which is non-NULL iff
the folio is in the page cache.
Use the xas pointer instead and drop the parameter, along with its
kerneldoc entry.
Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
Reviewed-by: Yeoreum Yun <yeoreum.yun@xxxxxxx>
Reviewed-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Signed-off-by: Kairui Song <kasong@xxxxxxxxxxx>
---
mm/huge_memory.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index d31c1d3d1f8e..16b142de5008 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3833,7 +3833,6 @@ static void __split_folio_to_order(struct folio *folio, int old_order,
* @split_at: in buddy allocator like split, the folio containing @split_at
* will be split until its order becomes @new_order.
* @xas: xa_state pointing to folio->mapping->i_pages and locked by caller
- * @mapping: @folio->mapping
* @split_type: if the split is uniform or not (buddy allocator like split)
*
*
@@ -3866,7 +3865,7 @@ static void __split_folio_to_order(struct folio *folio, int old_order,
*/
static int __split_frozen_folio(struct folio *folio, int new_order,
struct page *split_at, struct xa_state *xas,
- struct address_space *mapping, enum split_type split_type)
+ enum split_type split_type)
{
const bool is_anon = folio_test_anon(folio);
int old_order = folio_order(folio);
@@ -3890,7 +3889,7 @@ static int __split_frozen_folio(struct folio *folio, int new_order,
if (is_anon && split_order == 1)
continue;
- if (mapping) {
+ if (xas) {
/*
* uniform split has xas_split_alloc() called before
* irq is disabled to allocate enough memory, whereas
@@ -4089,8 +4088,7 @@ static int __folio_freeze_split_anon(struct folio *folio,
if (do_lru)
lruvec = folio_lruvec_lock(folio);
- ret = __split_frozen_folio(folio, new_order, split_at, NULL,
- NULL, split_type);
+ ret = __split_frozen_folio(folio, new_order, split_at, NULL, split_type);
/*
* Unfreeze the after-split folios and put them back to the right
@@ -4226,8 +4224,7 @@ static int __folio_freeze_split_file(struct folio *folio,
/* lock lru list/PageCompound, ref frozen by page_ref_freeze */
lruvec = folio_lruvec_lock(folio);
- ret = __split_frozen_folio(folio, new_order, split_at, &xas,
- mapping, split_type);
+ ret = __split_frozen_folio(folio, new_order, split_at, &xas, split_type);
/*
* Unfreeze after-split folios and put them back to the right
--
2.55.0