The patch titled Subject: zsmalloc: extend compaction statistics has been added to the -mm mm-unstable branch. Its filename is zsmalloc-extend-compaction-statistics.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/zsmalloc-extend-compaction-statistics.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx> Subject: zsmalloc: extend compaction statistics Date: Thu, 23 Feb 2023 12:04:50 +0900 Extend zsmalloc zs_pool_stats with a new member that holds the number of objects pool compaction moved between pool pages. Link: https://lkml.kernel.org/r/20230223030451.543162-6-senozhatsky@xxxxxxxxxxxx Signed-off-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx> Cc: Minchan Kim <minchan@xxxxxxxxxx> Cc: Yosry Ahmed <yosryahmed@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/zsmalloc.h | 2 ++ mm/zsmalloc.c | 1 + 2 files changed, 3 insertions(+) --- a/include/linux/zsmalloc.h~zsmalloc-extend-compaction-statistics +++ a/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; --- a/mm/zsmalloc.c~zsmalloc-extend-compaction-statistics +++ a/mm/zsmalloc.c @@ -1815,6 +1815,7 @@ static void migrate_zspage(struct zs_poo 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 */ _ Patches currently in -mm which might be from senozhatsky@xxxxxxxxxxxx are zsmalloc-remove-insert_zspage-inuse-optimization.patch zsmalloc-remove-stat-and-fullness-enums.patch zsmalloc-fine-grained-inuse-ratio-based-fullness-grouping.patch zsmalloc-rework-compaction-algorithm.patch zsmalloc-extend-compaction-statistics.patch zram-show-zsmalloc-objs_moved-stat-in-mm_stat.patch