[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <25cab6bc87a6cd69983e2fa0908441bc37015c98.1761439133.git.jinji.z.zhong@gmail.com>
Date: Sun, 26 Oct 2025 01:05:10 +0000
From: jinji zhong <jinji.z.zhong@...il.com>
To: minchan@...nel.org,
senozhatsky@...omium.org,
philipp.reisner@...bit.com,
lars.ellenberg@...bit.com,
christoph.boehmwalder@...bit.com,
corbet@....net,
tj@...nel.org,
hannes@...xchg.org,
mkoutny@...e.com,
axboe@...nel.dk,
mhocko@...nel.org,
roman.gushchin@...ux.dev,
shakeel.butt@...ux.dev,
akpm@...ux-foundation.org,
terrelln@...com,
dsterba@...e.com
Cc: muchun.song@...ux.dev,
linux-kernel@...r.kernel.org,
drbd-dev@...ts.linbit.com,
linux-doc@...r.kernel.org,
cgroups@...r.kernel.org,
linux-block@...r.kernel.org,
linux-mm@...ck.org,
zhongjinji@...or.com,
liulu.liu@...or.com,
feng.han@...or.com,
jinji zhong <jinji.z.zhong@...il.com>
Subject: [RFC PATCH 3/3] Doc: Update documentation for per-cgroup compression priority
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
Powered by blists - more mailing lists