[PATCH v2 3/8] mm/rmap: use folio_page_swap_entry() in ttu_anon_swapbacked_folio()

From: Tal Zussman

Date: Tue Sep 08 2026 - 11:51:49 EST


We already have the folio here, so use folio_page_swap_entry() instead
of going through page_swap_entry(). This saves a call to
compound_head().

No functional change.

Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
---
mm/rmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/rmap.c b/mm/rmap.c
index 5fefe5b060b1..193e1264b631 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -2147,7 +2147,7 @@ static bool ttu_anon_swapbacked_folio(struct vm_area_struct *vma,
{
const bool anon_exclusive = folio_test_anon(folio) &&
PageAnonExclusive(page);
- swp_entry_t entry = page_swap_entry(page);
+ swp_entry_t entry = folio_page_swap_entry(folio, page);
struct mm_struct *mm = vma->vm_mm;

if (folio_dup_swap(folio, page) < 0)

--
2.39.5