aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>2015-09-08 15:04:38 -0700
committerMister Oyster <oysterized@gmail.com>2017-09-25 20:44:00 +0200
commit0d6a7cc395ae51e7465e104771b91263d0a83a3e (patch)
treecae7c78881f798c1e9fb48e07c6692ac95f679d5 /include/linux
parent63ef108c5227fe6ee01012364afef1e951375ef4 (diff)
zsmalloc: account the number of compacted pages
Compaction returns back to zram the number of migrated objects, which is quite uninformative -- we have objects of different sizes so user space cannot obtain any valuable data from that number. Change compaction to operate in terms of pages and return back to compaction issuer the number of pages that were freed during compaction. So from now on we will export more meaningful value in zram<id>/mm_stat -- the number of freed (compacted) pages. This requires: (a) a rename of `num_migrated' to 'pages_compacted' (b) a internal API change -- return first_page's fullness_group from putback_zspage(), so we know when putback_zspage() did free_zspage(). It helps us to account compaction stats correctly. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Acked-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/zsmalloc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/zsmalloc.h b/include/linux/zsmalloc.h
index ad3d23239..6398dfae5 100644
--- a/include/linux/zsmalloc.h
+++ b/include/linux/zsmalloc.h
@@ -35,8 +35,8 @@ enum zs_mapmode {
};
struct zs_pool_stats {
- /* How many objects were migrated */
- unsigned long num_migrated;
+ /* How many pages were migrated (freed) */
+ unsigned long pages_compacted;
};
struct zs_pool;