Re: [PATCH v4 2/7] mm/page_owner: use order instead of nr in split_page_owner()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13.02.24 22:55, Zi Yan wrote:
From: Zi Yan <ziy@xxxxxxxxxx>

We do not have non power of two pages, using nr is error prone if nr
is not power-of-two. Use page order instead.

Signed-off-by: Zi Yan <ziy@xxxxxxxxxx>
---
  include/linux/page_owner.h | 8 ++++----
  mm/huge_memory.c           | 2 +-
  mm/page_alloc.c            | 4 ++--
  mm/page_owner.c            | 3 ++-
  4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/include/linux/page_owner.h b/include/linux/page_owner.h
index 119a0c9d2a8b..d7878523adfc 100644
--- a/include/linux/page_owner.h
+++ b/include/linux/page_owner.h
@@ -11,7 +11,7 @@ extern struct page_ext_operations page_owner_ops;
  extern void __reset_page_owner(struct page *page, unsigned short order);
  extern void __set_page_owner(struct page *page,
  			unsigned short order, gfp_t gfp_mask);
-extern void __split_page_owner(struct page *page, unsigned int nr);
+extern void __split_page_owner(struct page *page, int 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 __dump_page_owner(const struct page *page);
@@ -31,10 +31,10 @@ static inline void set_page_owner(struct page *page,
  		__set_page_owner(page, order, gfp_mask);
  }
-static inline void split_page_owner(struct page *page, unsigned int nr)
+static inline void split_page_owner(struct page *page, int order)
  {
  	if (static_branch_unlikely(&page_owner_inited))
-		__split_page_owner(page, nr);
+		__split_page_owner(page, order);
  }
  static inline void folio_copy_owner(struct folio *newfolio, struct folio *old)
  {
@@ -60,7 +60,7 @@ static inline void set_page_owner(struct page *page,
  {
  }
  static inline void split_page_owner(struct page *page,
-			unsigned short order)
+			int order)

I assume this will fit into a single line now.



Acked-by: David Hildenbrand <david@xxxxxxxxxx>

--
Cheers,

David / dhildenb





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux