[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240621054658.1220796-11-alexs@kernel.org>
Date: Fri, 21 Jun 2024 13:46:50 +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
Cc: Alex Shi <alexs@...nel.org>
Subject: [PATCH 10/15] mm/z3fold: use zpdesc in __z3fold_alloc
From: Alex Shi <alexs@...nel.org>
The main purpose is converting page->private to zpdesc->zppage_flag.
Signed-off-by: Alex Shi <alexs@...nel.org>
---
mm/z3fold.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/mm/z3fold.c b/mm/z3fold.c
index 3d36448885c9..f164eb4e1139 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -790,7 +790,7 @@ static inline struct z3fold_header *__z3fold_alloc(struct z3fold_pool *pool,
size_t size, bool can_sleep)
{
struct z3fold_header *zhdr = NULL;
- struct page *page;
+ struct zpdesc *zpdesc;
struct list_head *unbuddied;
int chunks = size_to_chunks(size), i;
@@ -823,9 +823,9 @@ static inline struct z3fold_header *__z3fold_alloc(struct z3fold_pool *pool,
zhdr->cpu = -1;
spin_unlock(&pool->lock);
- page = virt_to_page(zhdr);
- if (test_bit(NEEDS_COMPACTING, &page->private) ||
- test_bit(PAGE_CLAIMED, &page->private)) {
+ zpdesc = page_zpdesc(virt_to_page(zhdr));
+ if (test_bit(NEEDS_COMPACTING, &zpdesc->zppage_flag) ||
+ test_bit(PAGE_CLAIMED, &zpdesc->zppage_flag)) {
z3fold_page_unlock(zhdr);
zhdr = NULL;
migrate_enable();
@@ -868,9 +868,9 @@ static inline struct z3fold_header *__z3fold_alloc(struct z3fold_pool *pool,
zhdr->cpu = -1;
spin_unlock(&pool->lock);
- page = virt_to_page(zhdr);
- if (test_bit(NEEDS_COMPACTING, &page->private) ||
- test_bit(PAGE_CLAIMED, &page->private)) {
+ zpdesc = page_zpdesc(virt_to_page(zhdr));
+ if (test_bit(NEEDS_COMPACTING, &zpdesc->zppage_flag) ||
+ test_bit(PAGE_CLAIMED, &zpdesc->zppage_flag)) {
z3fold_page_unlock(zhdr);
zhdr = NULL;
if (can_sleep)
--
2.43.0
Powered by blists - more mailing lists