[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240703040613.681396-21-alexs@kernel.org>
Date: Wed, 3 Jul 2024 12:06:10 +0800
From: alexs@...nel.org
To: Vitaly Wool <vitaly.wool@...sulko.com>,
Miaohe Lin <linmiaohe@...wei.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
minchan@...nel.org,
willy@...radead.org,
senozhatsky@...omium.org,
david@...hat.com,
42.hyeyoo@...il.com,
Yosry Ahmed <yosryahmed@...gle.com>,
nphamcs@...il.com
Cc: Alex Shi <alexs@...nel.org>
Subject: [PATCH v2 20/20] mm/zsmalloc: introduce __zpdesc_set_zsmalloc()
From: Alex Shi <alexs@...nel.org>
Add a helper __zpdesc_set_zsmalloc() for __SetPageZsmalloc(), and use
it in callers to make code clear.
Signed-off-by: Alex Shi <alexs@...nel.org>
---
mm/zpdesc.h | 5 +++++
mm/zsmalloc.c | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/mm/zpdesc.h b/mm/zpdesc.h
index e6a71c7a3254..d0e5929c1666 100644
--- a/mm/zpdesc.h
+++ b/mm/zpdesc.h
@@ -116,6 +116,11 @@ static inline void __zpdesc_clear_movable(struct zpdesc *zpdesc)
__ClearPageMovable(zpdesc_page(zpdesc));
}
+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));
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 9e87a17ed802..7bb85447de94 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1030,7 +1030,7 @@ static struct zspage *alloc_zspage(struct zs_pool *pool,
cache_free_zspage(pool, zspage);
return NULL;
}
- __SetPageZsmalloc(zpdesc_page(zpdesc));
+ __zpdesc_set_zsmalloc(zpdesc);
zpdesc_inc_zone_page_state(zpdesc);
zpdescs[i] = zpdesc;
@@ -1820,7 +1820,7 @@ static int zs_page_migrate(struct page *newpage, struct page *page,
VM_BUG_ON_PAGE(!zpdesc_is_isolated(zpdesc), zpdesc_page(zpdesc));
/* We're committed, tell the world that this is a Zsmalloc page. */
- __SetPageZsmalloc(zpdesc_page(newzpdesc));
+ __zpdesc_set_zsmalloc(newzpdesc);
/* The page is locked, so this pointer must remain valid */
zspage = get_zspage(zpdesc);
--
2.43.0
Powered by blists - more mailing lists