From: jinji zhong <jinji.z.zhong@gmail.com>
To: minchan@kernel.org, senozhatsky@chromium.org,
philipp.reisner@linbit.com, lars.ellenberg@linbit.com,
christoph.boehmwalder@linbit.com, corbet@lwn.net, tj@kernel.org,
hannes@cmpxchg.org, mkoutny@suse.com, axboe@kernel.dk,
mhocko@kernel.org, roman.gushchin@linux.dev,
shakeel.butt@linux.dev, akpm@linux-foundation.org,
terrelln@fb.com, dsterba@suse.com
Cc: muchun.song@linux.dev, linux-kernel@vger.kernel.org,
drbd-dev@lists.linbit.com, linux-doc@vger.kernel.org,
cgroups@vger.kernel.org, linux-block@vger.kernel.org,
linux-mm@kvack.org, zhongjinji@honor.com, liulu.liu@honor.com,
feng.han@honor.com, jinji zhong <jinji.z.zhong@gmail.com>
Subject: [RFC PATCH 3/3] Doc: Update documentation for per-cgroup compression priority
Date: Sun, 26 Oct 2025 01:05:10 +0000 [thread overview]
Message-ID: <25cab6bc87a6cd69983e2fa0908441bc37015c98.1761439133.git.jinji.z.zhong@gmail.com> (raw)
In-Reply-To: <cover.1761439133.git.jinji.z.zhong@gmail.com>
This patch updates the documentation, describing the newly
introduced per-cgroup compression priority mechanism.
---
Documentation/admin-guide/blockdev/zram.rst | 18 ++++++++++++++----
Documentation/admin-guide/cgroup-v2.rst | 7 +++++++
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/Documentation/admin-guide/blockdev/zram.rst b/Documentation/admin-guide/blockdev/zram.rst
index 3e273c1bb749..de4ab060f664 100644
--- a/Documentation/admin-guide/blockdev/zram.rst
+++ b/Documentation/admin-guide/blockdev/zram.rst
@@ -452,12 +452,12 @@ using more effective algorithm and, hence, reduce zsmalloc memory usage.
With CONFIG_ZRAM_MULTI_COMP, zram supports up to 4 compression algorithms:
one primary and up to 3 secondary ones. Primary zram compressor is explained
in "3) Select compression algorithm", secondary algorithms are configured
-using recomp_algorithm device attribute.
+using multi_comp_algorithm device attribute.
Example:::
#show supported recompression algorithms
- cat /sys/block/zramX/recomp_algorithm
+ cat /sys/block/zramX/multi_comp_algorithm
#1: lzo lzo-rle lz4 lz4hc [zstd]
#2: lzo lzo-rle lz4 [lz4hc] zstd
@@ -468,10 +468,10 @@ Alternative compression algorithm's priority is provided during algorithms
configuration:::
#select zstd recompression algorithm, priority 1
- echo "algo=zstd priority=1" > /sys/block/zramX/recomp_algorithm
+ echo "algo=zstd priority=1" > /sys/block/zramX/multi_comp_algorithm
#select deflate recompression algorithm, priority 2
- echo "algo=deflate priority=2" > /sys/block/zramX/recomp_algorithm
+ echo "algo=deflate priority=2" > /sys/block/zramX/multi_comp_algorithm
Another device attribute that CONFIG_ZRAM_MULTI_COMP enables is recompress,
which controls recompression.
@@ -524,6 +524,16 @@ This can be achieved by providing a `algo` or `priority` parameter:::
#use zstd algorithm only (if zstd was registered under priority 1)
echo "type=huge priority=1" > /sys/block/zramX/recompress
+per-cgroup compression algorithms
+-------------
+With CONFIG_ZRAM_MULTI_COMP, zram can compress pages using the compression
+algorithm determined by the cgroup. It will get the compression priority from
+the cgroup and use the corresponding compression algorithm to compress the page.
+
+To use the feature, admin should enable per-cgroup compression via::
+
+ echo 1 > /sys/block/zramX/per_cgroup_comp_enable
+
memory tracking
===============
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index 0e6c67ac585a..1706d8f0d225 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1871,6 +1871,13 @@ The following nested keys are defined.
higher than the limit for an extended period of time. This
reduces the impact on the workload and memory management.
+ memory.swap.compress_priority
+ A read-write single value file which exists on non-root
+ cgroups. The default is "0".
+
+ swap compress priority for the cgroup. Different compression
+ priorities mean different compression algorithms.
+
memory.zswap.current
A read-only single value file which exists on non-root
cgroups.
--
2.48.1
next prev parent reply other threads:[~2025-10-26 1:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-26 1:05 [RFC PATCH 0/3] Introduce " jinji zhong
2025-10-26 1:05 ` [RFC PATCH 1/3] mm/memcontrol: " jinji zhong
2025-10-26 1:05 ` [RFC PATCH 2/3] zram: Zram supports " jinji zhong
2025-10-26 1:05 ` jinji zhong [this message]
2025-10-27 16:06 ` [RFC PATCH 0/3] Introduce " Tejun Heo
2025-10-30 9:22 ` zhongjinji
2025-10-27 17:29 ` Shakeel Butt
2025-10-30 11:32 ` zhongjinji
2025-10-27 22:46 ` Nhat Pham
2025-10-28 3:31 ` 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=25cab6bc87a6cd69983e2fa0908441bc37015c98.1761439133.git.jinji.z.zhong@gmail.com \
--to=jinji.z.zhong@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=christoph.boehmwalder@linbit.com \
--cc=corbet@lwn.net \
--cc=drbd-dev@lists.linbit.com \
--cc=dsterba@suse.com \
--cc=feng.han@honor.com \
--cc=hannes@cmpxchg.org \
--cc=lars.ellenberg@linbit.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liulu.liu@honor.com \
--cc=mhocko@kernel.org \
--cc=minchan@kernel.org \
--cc=mkoutny@suse.com \
--cc=muchun.song@linux.dev \
--cc=philipp.reisner@linbit.com \
--cc=roman.gushchin@linux.dev \
--cc=senozhatsky@chromium.org \
--cc=shakeel.butt@linux.dev \
--cc=terrelln@fb.com \
--cc=tj@kernel.org \
--cc=zhongjinji@honor.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox