Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/page_owner: convert set_page_owner_migrate_reason() to folios

Both callers of set_page_owner_migrate_reason() use folios. Convert the
function to take a folio directly and move the &folio->page conversion
inside __set_page_owner_migrate_reason().

Link: https://lkml.kernel.org/r/20250711145910.90135-1-sidhartha.kumar@oracle.com
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Sidhartha Kumar and committed by
Andrew Morton
9989db9f 5bd88fef

+8 -8
+4 -4
include/linux/page_owner.h
··· 14 14 extern void __split_page_owner(struct page *page, int old_order, 15 15 int new_order); 16 16 extern void __folio_copy_owner(struct folio *newfolio, struct folio *old); 17 - extern void __set_page_owner_migrate_reason(struct page *page, int reason); 17 + extern void __folio_set_owner_migrate_reason(struct folio *folio, int reason); 18 18 extern void __dump_page_owner(const struct page *page); 19 19 extern void pagetypeinfo_showmixedcount_print(struct seq_file *m, 20 20 pg_data_t *pgdat, struct zone *zone); ··· 43 43 if (static_branch_unlikely(&page_owner_inited)) 44 44 __folio_copy_owner(newfolio, old); 45 45 } 46 - static inline void set_page_owner_migrate_reason(struct page *page, int reason) 46 + static inline void folio_set_owner_migrate_reason(struct folio *folio, int reason) 47 47 { 48 48 if (static_branch_unlikely(&page_owner_inited)) 49 - __set_page_owner_migrate_reason(page, reason); 49 + __folio_set_owner_migrate_reason(folio, reason); 50 50 } 51 51 static inline void dump_page_owner(const struct page *page) 52 52 { ··· 68 68 static inline void folio_copy_owner(struct folio *newfolio, struct folio *folio) 69 69 { 70 70 } 71 - static inline void set_page_owner_migrate_reason(struct page *page, int reason) 71 + static inline void folio_set_owner_migrate_reason(struct folio *folio, int reason) 72 72 { 73 73 } 74 74 static inline void dump_page_owner(const struct page *page)
+1 -1
mm/hugetlb.c
··· 7835 7835 struct hstate *h = folio_hstate(old_folio); 7836 7836 7837 7837 hugetlb_cgroup_migrate(old_folio, new_folio); 7838 - set_page_owner_migrate_reason(&new_folio->page, reason); 7838 + folio_set_owner_migrate_reason(new_folio, reason); 7839 7839 7840 7840 /* 7841 7841 * transfer temporary state of the new hugetlb folio. This is
+1 -1
mm/migrate.c
··· 1367 1367 1368 1368 out_unlock_both: 1369 1369 folio_unlock(dst); 1370 - set_page_owner_migrate_reason(&dst->page, reason); 1370 + folio_set_owner_migrate_reason(dst, reason); 1371 1371 /* 1372 1372 * If migration is successful, decrease refcount of dst, 1373 1373 * which will not free the page because new page owner increased
+2 -2
mm/page_owner.c
··· 333 333 inc_stack_record_count(handle, gfp_mask, 1 << order); 334 334 } 335 335 336 - void __set_page_owner_migrate_reason(struct page *page, int reason) 336 + void __folio_set_owner_migrate_reason(struct folio *folio, int reason) 337 337 { 338 - struct page_ext *page_ext = page_ext_get(page); 338 + struct page_ext *page_ext = page_ext_get(&folio->page); 339 339 struct page_owner *page_owner; 340 340 341 341 if (unlikely(!page_ext))