linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios
@ 2025-07-11 14:59 Sidhartha Kumar
  2025-07-11 15:04 ` Matthew Wilcox
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Sidhartha Kumar @ 2025-07-11 14:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-mm, akpm, willy, muchun.song, osalvador, ziy, vbabka,
	Sidhartha Kumar

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().

Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
---
 include/linux/page_owner.h | 8 ++++----
 mm/hugetlb.c               | 2 +-
 mm/migrate.c               | 2 +-
 mm/page_owner.c            | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/linux/page_owner.h b/include/linux/page_owner.h
index debdc25f08b9..3328357f6dba 100644
--- a/include/linux/page_owner.h
+++ b/include/linux/page_owner.h
@@ -14,7 +14,7 @@ extern void __set_page_owner(struct page *page,
 extern void __split_page_owner(struct page *page, int old_order,
 			int new_order);
 extern void __folio_copy_owner(struct folio *newfolio, struct folio *old);
-extern void __set_page_owner_migrate_reason(struct page *page, int reason);
+extern void __folio_set_owner_migrate_reason(struct folio *folio, int reason);
 extern void __dump_page_owner(const struct page *page);
 extern void pagetypeinfo_showmixedcount_print(struct seq_file *m,
 					pg_data_t *pgdat, struct zone *zone);
@@ -43,10 +43,10 @@ static inline void folio_copy_owner(struct folio *newfolio, struct folio *old)
 	if (static_branch_unlikely(&page_owner_inited))
 		__folio_copy_owner(newfolio, old);
 }
-static inline void set_page_owner_migrate_reason(struct page *page, int reason)
+static inline void folio_set_owner_migrate_reason(struct folio *folio, int reason)
 {
 	if (static_branch_unlikely(&page_owner_inited))
-		__set_page_owner_migrate_reason(page, reason);
+		__folio_set_owner_migrate_reason(folio, reason);
 }
 static inline void dump_page_owner(const struct page *page)
 {
@@ -68,7 +68,7 @@ static inline void split_page_owner(struct page *page, int old_order,
 static inline void folio_copy_owner(struct folio *newfolio, struct folio *folio)
 {
 }
-static inline void set_page_owner_migrate_reason(struct page *page, int reason)
+static inline void folio_set_owner_migrate_reason(struct folio *folio, int reason)
 {
 }
 static inline void dump_page_owner(const struct page *page)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index f13fa5aa6624..753f99b4c718 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -7835,7 +7835,7 @@ void move_hugetlb_state(struct folio *old_folio, struct folio *new_folio, int re
 	struct hstate *h = folio_hstate(old_folio);
 
 	hugetlb_cgroup_migrate(old_folio, new_folio);
-	set_page_owner_migrate_reason(&new_folio->page, reason);
+	folio_set_owner_migrate_reason(new_folio, reason);
 
 	/*
 	 * transfer temporary state of the new hugetlb folio. This is
diff --git a/mm/migrate.c b/mm/migrate.c
index 36b2764204b6..425401b2d4e1 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1367,7 +1367,7 @@ static int migrate_folio_move(free_folio_t put_new_folio, unsigned long private,
 
 out_unlock_both:
 	folio_unlock(dst);
-	set_page_owner_migrate_reason(&dst->page, reason);
+	folio_set_owner_migrate_reason(dst, reason);
 	/*
 	 * If migration is successful, decrease refcount of dst,
 	 * which will not free the page because new page owner increased
diff --git a/mm/page_owner.c b/mm/page_owner.c
index 9928c9ac8c31..c3ca21132c2c 100644
--- a/mm/page_owner.c
+++ b/mm/page_owner.c
@@ -333,9 +333,9 @@ noinline void __set_page_owner(struct page *page, unsigned short order,
 	inc_stack_record_count(handle, gfp_mask, 1 << order);
 }
 
-void __set_page_owner_migrate_reason(struct page *page, int reason)
+void __folio_set_owner_migrate_reason(struct folio *folio, int reason)
 {
-	struct page_ext *page_ext = page_ext_get(page);
+	struct page_ext *page_ext = page_ext_get(&folio->page);
 	struct page_owner *page_owner;
 
 	if (unlikely(!page_ext))
-- 
2.43.0




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios
  2025-07-11 14:59 [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios Sidhartha Kumar
@ 2025-07-11 15:04 ` Matthew Wilcox
  2025-07-11 15:19 ` David Hildenbrand
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2025-07-11 15:04 UTC (permalink / raw)
  To: Sidhartha Kumar
  Cc: linux-kernel, linux-mm, akpm, muchun.song, osalvador, ziy, vbabka

On Fri, Jul 11, 2025 at 10:59:10AM -0400, Sidhartha Kumar wrote:
> 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().
> 
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios
  2025-07-11 14:59 [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios Sidhartha Kumar
  2025-07-11 15:04 ` Matthew Wilcox
@ 2025-07-11 15:19 ` David Hildenbrand
  2025-07-11 15:25 ` Zi Yan
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: David Hildenbrand @ 2025-07-11 15:19 UTC (permalink / raw)
  To: Sidhartha Kumar, linux-kernel
  Cc: linux-mm, akpm, willy, muchun.song, osalvador, ziy, vbabka

On 11.07.25 16:59, Sidhartha Kumar wrote:
> 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().
> 
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
> ---

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios
  2025-07-11 14:59 [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios Sidhartha Kumar
  2025-07-11 15:04 ` Matthew Wilcox
  2025-07-11 15:19 ` David Hildenbrand
@ 2025-07-11 15:25 ` Zi Yan
  2025-07-11 16:49 ` Vishal Moola (Oracle)
  2025-07-16  8:50 ` Oscar Salvador
  4 siblings, 0 replies; 6+ messages in thread
From: Zi Yan @ 2025-07-11 15:25 UTC (permalink / raw)
  To: Sidhartha Kumar
  Cc: linux-kernel, linux-mm, akpm, willy, muchun.song, osalvador,
	vbabka

On 11 Jul 2025, at 10:59, Sidhartha Kumar wrote:

> 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().
>
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
> ---
>  include/linux/page_owner.h | 8 ++++----
>  mm/hugetlb.c               | 2 +-
>  mm/migrate.c               | 2 +-
>  mm/page_owner.c            | 4 ++--
>  4 files changed, 8 insertions(+), 8 deletions(-)
>
Reviewed-by: Zi Yan <ziy@nvidia.com>

Best Regards,
Yan, Zi


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios
  2025-07-11 14:59 [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios Sidhartha Kumar
                   ` (2 preceding siblings ...)
  2025-07-11 15:25 ` Zi Yan
@ 2025-07-11 16:49 ` Vishal Moola (Oracle)
  2025-07-16  8:50 ` Oscar Salvador
  4 siblings, 0 replies; 6+ messages in thread
From: Vishal Moola (Oracle) @ 2025-07-11 16:49 UTC (permalink / raw)
  To: Sidhartha Kumar
  Cc: linux-kernel, linux-mm, akpm, willy, muchun.song, osalvador, ziy,
	vbabka

On Fri, Jul 11, 2025 at 10:59:10AM -0400, Sidhartha Kumar wrote:
> 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().
> 
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
> ---

Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios
  2025-07-11 14:59 [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios Sidhartha Kumar
                   ` (3 preceding siblings ...)
  2025-07-11 16:49 ` Vishal Moola (Oracle)
@ 2025-07-16  8:50 ` Oscar Salvador
  4 siblings, 0 replies; 6+ messages in thread
From: Oscar Salvador @ 2025-07-16  8:50 UTC (permalink / raw)
  To: Sidhartha Kumar
  Cc: linux-kernel, linux-mm, akpm, willy, muchun.song, ziy, vbabka

On Fri, Jul 11, 2025 at 10:59:10AM -0400, Sidhartha Kumar wrote:
> 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().
> 
> Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>

Reviewed-by: Oscar Salvador <osalvador@suse.de>

 

-- 
Oscar Salvador
SUSE Labs


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-16  8:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-11 14:59 [PATCH] mm/page_owner: convert set_page_owner_migrate_reason() to folios Sidhartha Kumar
2025-07-11 15:04 ` Matthew Wilcox
2025-07-11 15:19 ` David Hildenbrand
2025-07-11 15:25 ` Zi Yan
2025-07-11 16:49 ` Vishal Moola (Oracle)
2025-07-16  8:50 ` Oscar Salvador

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).