[PATCH RFC 3/8] mm/huge_memory: avoid an unnecessary folio size reading

From: Kairui Song via B4 Relay

Date: Fri Nov 13 2026 - 16:58:06 EST


From: Kairui Song <kasong@xxxxxxxxxxx>

We already have that in the local variable, a trivial cleanup.

Signed-off-by: Kairui Song <kasong@xxxxxxxxxxx>
---
mm/huge_memory.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 0d589be136d2..b60fd73fe35c 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -4287,9 +4287,7 @@ static int __folio_freeze_split_file(struct folio *folio,
/* compute next before the folio can be freed below */
next = folio_next(new_folio);

- folio_ref_unfreeze(new_folio,
- folio_nr_pages(new_folio) + 1);
-
+ folio_ref_unfreeze(new_folio, nr_pages + 1);
lru_add_split_folio(folio, new_folio, lruvec, list);

/* Add the new folio to the page cache. */

--
2.56.1