[PATCH v4 17/17] mm/huge_memory: drop the redundant mapping argument of __split_frozen_folio

From: Kairui Song via B4 Relay

Date: Mon Sep 07 2026 - 14:14:06 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>
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 661b1c747c33..c98756bcc5ec 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3825,7 +3825,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)
*
*
@@ -3858,7 +3857,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);
@@ -3882,7 +3881,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
@@ -4060,8 +4059,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
@@ -4197,8 +4195,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