From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: [PATCH 4/6] Documentation: document zram pool_page_order attribute
Date: Tue, 25 Oct 2022 01:12:11 +0900 [thread overview]
Message-ID: <20221024161213.3221725-5-senozhatsky@chromium.org> (raw)
In-Reply-To: <20221024161213.3221725-1-senozhatsky@chromium.org>
Provide a simple documentation for zram pool_page_order
device attribute.
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
---
Documentation/admin-guide/blockdev/zram.rst | 31 ++++++++++++++++-----
1 file changed, 24 insertions(+), 7 deletions(-)
diff --git a/Documentation/admin-guide/blockdev/zram.rst b/Documentation/admin-guide/blockdev/zram.rst
index 010fb05a5999..cd12a5982ae0 100644
--- a/Documentation/admin-guide/blockdev/zram.rst
+++ b/Documentation/admin-guide/blockdev/zram.rst
@@ -112,7 +112,24 @@ to list all of them using, for instance, /proc/crypto or any other
method. This, however, has an advantage of permitting the usage of
custom crypto compression modules (implementing S/W or H/W compression).
-4) Set Disksize
+4) Set maximum pool page order
+==============================
+
+zsmalloc pages can consist of up to 2^N physical pages. The exact size
+is calculated per each zsmalloc size class during zsmalloc pool creation.
+ZRAM provides pool_page_order device attribute to see or change N.
+
+Examples::
+
+ #show current maximum zsmalloc page order
+ cat /sys/block/zramX/pool_page_order
+ 2
+
+ #set maximum zsmalloc page order
+ echo 3 > /sys/block/zramX/pool_page_order
+
+
+5) Set Disksize
===============
Set disk size by writing the value to sysfs node 'disksize'.
@@ -132,7 +149,7 @@ There is little point creating a zram of greater than twice the size of memory
since we expect a 2:1 compression ratio. Note that zram uses about 0.1% of the
size of the disk when not in use so a huge zram is wasteful.
-5) Set memory limit: Optional
+6) Set memory limit: Optional
=============================
Set memory limit by writing the value to sysfs node 'mem_limit'.
@@ -151,7 +168,7 @@ Examples::
# To disable memory limit
echo 0 > /sys/block/zram0/mem_limit
-6) Activate
+7) Activate
===========
::
@@ -162,7 +179,7 @@ Examples::
mkfs.ext4 /dev/zram1
mount /dev/zram1 /tmp
-7) Add/remove zram devices
+8) Add/remove zram devices
==========================
zram provides a control interface, which enables dynamic (on-demand) device
@@ -182,7 +199,7 @@ execute::
echo X > /sys/class/zram-control/hot_remove
-8) Stats
+9) Stats
========
Per-device statistics are exported as various nodes under /sys/block/zram<id>/
@@ -283,7 +300,7 @@ a single line of text and contains the following stats separated by whitespace:
Unit: 4K bytes
============== =============================================================
-9) Deactivate
+10) Deactivate
=============
::
@@ -291,7 +308,7 @@ a single line of text and contains the following stats separated by whitespace:
swapoff /dev/zram0
umount /dev/zram1
-10) Reset
+11) Reset
=========
Write any positive value to 'reset' sysfs node::
--
2.38.0.135.g90850a2211-goog
next prev parent reply other threads:[~2022-10-24 16:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 16:12 [PATCH 0/6] zsmalloc/zram: configurable zspage size Sergey Senozhatsky
2022-10-24 16:12 ` [PATCH 1/6] zsmalloc: turn zspage order into runtime variable Sergey Senozhatsky
2022-10-24 16:12 ` [PATCH 2/6] zsmalloc/zram: pass zspage order to zs_create_pool() Sergey Senozhatsky
2022-10-24 16:12 ` [PATCH 3/6] zram: add pool_page_order device attribute Sergey Senozhatsky
2022-10-24 16:12 ` Sergey Senozhatsky [this message]
2022-10-24 16:12 ` [PATCH 5/6] zsmalloc: break out of loop when found perfect zspage order Sergey Senozhatsky
2022-10-24 16:12 ` [PATCH 6/6] zsmalloc: make sure we select best zspage size Sergey Senozhatsky
2022-10-25 3:26 ` [PATCH 0/6] zsmalloc/zram: configurable " Bagas Sanjaya
2022-10-25 3:42 ` Sergey Senozhatsky
2022-10-25 8:40 ` Bagas Sanjaya
2022-10-25 4:30 ` Sergey Senozhatsky
2022-10-25 7:57 ` Sergey Senozhatsky
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=20221024161213.3221725-5-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=ngupta@vflare.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox