Re: [PATCH v1 06/29] mm/zsmalloc: make PageZsmalloc() sticky until the page is freed

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

 



On 30.06.25 18:03, Lorenzo Stoakes wrote:
On Mon, Jun 30, 2025 at 02:59:47PM +0200, David Hildenbrand wrote:
Let the page freeing code handle clearing the page type.

Acked-by: Zi Yan <ziy@xxxxxxxxxx>
Reviewed-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>
Acked-by: Harry Yoo <harry.yoo@xxxxxxxxxx>
Signed-off-by: David Hildenbrand <david@xxxxxxxxxx>

On basis of sanity of UINT_MAX thing:

Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>

---
  mm/zpdesc.h   | 5 -----
  mm/zsmalloc.c | 3 +--
  2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/mm/zpdesc.h b/mm/zpdesc.h
index 5cb7e3de43952..5763f36039736 100644
--- a/mm/zpdesc.h
+++ b/mm/zpdesc.h
@@ -163,11 +163,6 @@ static inline void __zpdesc_set_zsmalloc(struct zpdesc *zpdesc)
  	__SetPageZsmalloc(zpdesc_page(zpdesc));
  }

-static inline void __zpdesc_clear_zsmalloc(struct zpdesc *zpdesc)
-{
-	__ClearPageZsmalloc(zpdesc_page(zpdesc));
-}
-
  static inline struct zone *zpdesc_zone(struct zpdesc *zpdesc)
  {
  	return page_zone(zpdesc_page(zpdesc));
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 7f1431f2be98f..f98747aed4330 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -880,7 +880,7 @@ static void reset_zpdesc(struct zpdesc *zpdesc)
  	ClearPagePrivate(page);
  	zpdesc->zspage = NULL;
  	zpdesc->next = NULL;
-	__ClearPageZsmalloc(page);
+	/* PageZsmalloc is sticky until the page is freed to the buddy. */
  }

  static int trylock_zspage(struct zspage *zspage)
@@ -1055,7 +1055,6 @@ static struct zspage *alloc_zspage(struct zs_pool *pool,
  		if (!zpdesc) {
  			while (--i >= 0) {
  				zpdesc_dec_zone_page_state(zpdescs[i]);

Maybe for consistency put a

/* PageZsmalloc is sticky until the page is freed to the buddy. */


I'll add that inside free_zpdesc(), before the __free_page().

Thanks!

--
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