From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,minchan@kernel.org,corbet@lwn.net,senozhatsky@chromium.org,akpm@linux-foundation.org
Subject: [merged mm-stable] documentation-zram-correct-algo-parameters-configuration-documentation.patch removed from -mm tree
Date: Mon, 24 Aug 2026 18:45:22 -0700 [thread overview]
Message-ID: <20260825014523.2B4501F00A3A@smtp.kernel.org> (raw)
The quilt patch titled
Subject: Documentation: zram: correct algo parameters configuration documentation
has been removed from the -mm tree. Its filename was
documentation-zram-correct-algo-parameters-configuration-documentation.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: Documentation: zram: correct algo parameters configuration documentation
Date: Thu, 30 Jul 2026 16:51:46 +0900
zram has always reset all previously set parameters for the given
algorithm in comp_params_store(). Make documentation more clear and
explicitly state that all relevant/necessary parameters should be set in
one configuration write.
Link: https://lore.kernel.org/20260730075158.1339787-1-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
Documentation/admin-guide/blockdev/zram.rst | 34 +++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
--- a/Documentation/admin-guide/blockdev/zram.rst~documentation-zram-correct-algo-parameters-configuration-documentation
+++ a/Documentation/admin-guide/blockdev/zram.rst
@@ -109,14 +109,41 @@ path to the `dict` along with other para
#pass path to pre-trained zstd dictionary
echo "algo=zstd dict=/etc/dictionary" > /sys/block/zram0/algorithm_params
+ #pass path to pre-trained zstd dictionary and compression level
+ echo "algo=zstd level=8 dict=/etc/dictionary" > \
+ /sys/block/zram0/algorithm_params
+
#same, but using algorithm priority
+ echo "algo=zstd priority=1" > /sys/block/zram0/recomp_algorithm
echo "priority=1 dict=/etc/dictionary" > \
/sys/block/zram0/algorithm_params
- #pass path to pre-trained zstd dictionary and compression level
+Each write to `algorithm_params` replaces the entire set of parameters of
+the corresponding algorithm, parameters that are not listed in the write
+are reset to their default values. Configure all of the parameters of an
+algorithm in one write::
+
+ #WRONG: the second write resets level back to its default value
+ echo "algo=zstd level=8" > /sys/block/zram0/algorithm_params
+ echo "algo=zstd dict=/etc/dictionary" > /sys/block/zram0/algorithm_params
+
+ #RIGHT
echo "algo=zstd level=8 dict=/etc/dictionary" > \
/sys/block/zram0/algorithm_params
+Select the compression algorithm before configuring its parameters. The
+parameters of one algorithm are not necessarily valid for another one, so
+changing the algorithm of a particular priority resets that priority's
+parameters::
+
+ #WRONG: comp_algorithm write resets the previously configured level
+ echo "level=8" > /sys/block/zram0/algorithm_params
+ echo zstd > /sys/block/zram0/comp_algorithm
+
+ #RIGHT
+ echo zstd > /sys/block/zram0/comp_algorithm
+ echo "algo=zstd level=8" > /sys/block/zram0/algorithm_params
+
Parameters are algorithm specific: not all algorithms support pre-trained
dictionaries, not all algorithms support `level`. Furthermore, for certain
algorithms `level` controls the compression level (the higher the value the
@@ -124,6 +151,11 @@ better the compression ratio, it even ca
algorithms), for other algorithms `level` is acceleration level (the higher
the value the lower the compression ratio).
+Parameters are handed over to the compression algorithm when the device is
+initialised, hence invalid parameters (or parameters that the selected
+algorithm does not support) are reported by the `disksize` write, and not
+by the `algorithm_params` write that has configured them.
+
Set Disksize
============
_
Patches currently in -mm which might be from senozhatsky@chromium.org are
reply other threads:[~2026-08-25 1:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260825014523.2B4501F00A3A@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=minchan@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=senozhatsky@chromium.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 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.