[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230223030451.543162-6-senozhatsky@chromium.org>
Date: Thu, 23 Feb 2023 12:04:50 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Minchan Kim <minchan@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Yosry Ahmed <yosryahmed@...gle.com>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, Sergey Senozhatsky <senozhatsky@...omium.org>
Subject: [PATCHv2 5/6] zsmalloc: extend compaction statistics
Extend zsmalloc zs_pool_stats with a new member that
holds the number of objects pool compaction moved
between pool pages.
Signed-off-by: Sergey Senozhatsky <senozhatsky@...omium.org>
---
include/linux/zsmalloc.h | 2 ++
mm/zsmalloc.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/include/linux/zsmalloc.h b/include/linux/zsmalloc.h
index a48cd0ffe57d..8b3fa5b4a68c 100644
--- a/include/linux/zsmalloc.h
+++ b/include/linux/zsmalloc.h
@@ -36,6 +36,8 @@ enum zs_mapmode {
struct zs_pool_stats {
/* How many pages were migrated (freed) */
atomic_long_t pages_compacted;
+ /* How many objects were migrated during compaction */
+ atomic_long_t objs_moved;
};
struct zs_pool;
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index eacf9e32da5c..f7e69df48fb0 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1815,6 +1815,7 @@ static void migrate_zspage(struct zs_pool *pool, struct size_class *class,
obj_idx++;
record_obj(handle, free_obj);
obj_free(class->size, used_obj, NULL);
+ atomic_long_inc(&pool->stats.objs_moved);
}
/* Remember last position in this iteration */
--
2.39.2.637.g21b0678d19-goog
Powered by blists - more mailing lists