All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Minchan Kim <minchan@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Yosry Ahmed <yosryahmed@google.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: [PATCHv2 6/6] zram: show zsmalloc objs_moved stat in mm_stat
Date: Thu, 23 Feb 2023 12:04:51 +0900	[thread overview]
Message-ID: <20230223030451.543162-7-senozhatsky@chromium.org> (raw)
In-Reply-To: <20230223030451.543162-1-senozhatsky@chromium.org>

Extend zram mm_show with new objs_moved zs_pool_stats.

Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
---
 Documentation/admin-guide/blockdev/zram.rst | 1 +
 drivers/block/zram/zram_drv.c               | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Documentation/admin-guide/blockdev/zram.rst b/Documentation/admin-guide/blockdev/zram.rst
index e4551579cb12..699cdbf27e37 100644
--- a/Documentation/admin-guide/blockdev/zram.rst
+++ b/Documentation/admin-guide/blockdev/zram.rst
@@ -267,6 +267,7 @@ line of text and contains the following stats separated by whitespace:
  pages_compacted  the number of pages freed during compaction
  huge_pages	  the number of incompressible pages
  huge_pages_since the number of incompressible pages since zram set up
+ objs_moved       The number of objects moved during pool compaction
  ================ =============================================================
 
 File /sys/block/zram<id>/bd_stat
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index aa490da3cef2..3194e9254c6f 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1221,7 +1221,7 @@ static ssize_t mm_stat_show(struct device *dev,
 	max_used = atomic_long_read(&zram->stats.max_used_pages);
 
 	ret = scnprintf(buf, PAGE_SIZE,
-			"%8llu %8llu %8llu %8lu %8ld %8llu %8lu %8llu %8llu\n",
+			"%8llu %8llu %8llu %8lu %8ld %8llu %8lu %8llu %8llu %8llu\n",
 			orig_size << PAGE_SHIFT,
 			(u64)atomic64_read(&zram->stats.compr_data_size),
 			mem_used << PAGE_SHIFT,
@@ -1230,7 +1230,8 @@ static ssize_t mm_stat_show(struct device *dev,
 			(u64)atomic64_read(&zram->stats.same_pages),
 			atomic_long_read(&pool_stats.pages_compacted),
 			(u64)atomic64_read(&zram->stats.huge_pages),
-			(u64)atomic64_read(&zram->stats.huge_pages_since));
+			(u64)atomic64_read(&zram->stats.huge_pages_since),
+			(u64)atomic64_read(&pool_stats.objs_moved));
 	up_read(&zram->init_lock);
 
 	return ret;
-- 
2.39.2.637.g21b0678d19-goog


  parent reply	other threads:[~2023-02-23  3:05 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-23  3:04 [PATCHv2 0/6] zsmalloc: fine-grained fullness and new compaction algorithm Sergey Senozhatsky
2023-02-23  3:04 ` [PATCHv2 1/6] zsmalloc: remove insert_zspage() ->inuse optimization Sergey Senozhatsky
2023-02-23 23:09   ` Minchan Kim
2023-02-26  4:40     ` Sergey Senozhatsky
2023-02-23  3:04 ` [PATCHv2 2/6] zsmalloc: remove stat and fullness enums Sergey Senozhatsky
2023-02-23 23:11   ` Minchan Kim
2023-02-23 23:32     ` Yosry Ahmed
2023-02-26  4:39     ` Sergey Senozhatsky
2023-02-23  3:04 ` [PATCHv2 3/6] zsmalloc: fine-grained inuse ratio based fullness grouping Sergey Senozhatsky
2023-02-23 23:27   ` Minchan Kim
2023-02-26  4:38     ` Sergey Senozhatsky
2023-02-28 22:53       ` Minchan Kim
2023-03-01  4:05         ` Sergey Senozhatsky
2023-03-02  0:13           ` Minchan Kim
2023-03-01  8:55         ` Sergey Senozhatsky
2023-03-02  0:28           ` Minchan Kim
2023-03-02  0:53             ` Sergey Senozhatsky
2023-03-03  0:20               ` Minchan Kim
2023-03-03  1:06                 ` Sergey Senozhatsky
2023-03-03  1:38                   ` Minchan Kim
2023-03-03  1:43                     ` Sergey Senozhatsky
2023-02-23  3:04 ` [PATCHv2 4/6] zsmalloc: rework compaction algorithm Sergey Senozhatsky
2023-02-23 23:46   ` Minchan Kim
2023-02-26  4:09     ` Sergey Senozhatsky
2023-02-28 23:14   ` Minchan Kim
2023-03-01  3:47     ` Sergey Senozhatsky
2023-02-23  3:04 ` [PATCHv2 5/6] zsmalloc: extend compaction statistics Sergey Senozhatsky
2023-02-23 23:51   ` Minchan Kim
2023-02-26  3:55     ` Sergey Senozhatsky
2023-02-28 22:20       ` Minchan Kim
2023-03-01  3:54         ` Sergey Senozhatsky
2023-03-01 23:48           ` Minchan Kim
2023-03-03  1:57             ` Sergey Senozhatsky
2023-02-23  3:04 ` Sergey Senozhatsky [this message]
2023-02-23 23:53 ` [PATCHv2 0/6] zsmalloc: fine-grained fullness and new compaction algorithm Minchan Kim
2023-02-26  3:50   ` Sergey Senozhatsky
2023-02-28 22:17     ` Minchan Kim
2023-03-01  3:57       ` Sergey Senozhatsky
2023-03-01 23:48         ` Minchan Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230223030451.543162-7-senozhatsky@chromium.org \
    --to=senozhatsky@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=yosryahmed@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.