zram: introduce algorithm_params device attribute
authorSergey Senozhatsky <senozhatsky@chromium.org>
Mon, 2 Sep 2024 10:56:03 +0000 (19:56 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 9 Sep 2024 23:39:09 +0000 (16:39 -0700)
commit4eac932103a5d8c3a1bdf6776dbc1a178c31d896
tree8a2caaf827dcd6150c15d3f6571b99a655285227
parenteb826a01909a2d39660ed5a486ebc43e831254bc
zram: introduce algorithm_params device attribute

This attribute is used to setup compression algorithms' parameters, so we
can tweak algorithms' characteristics.  At this point only 'level' is
supported (to be extended in the future).

Each call sets up parameters for one particular algorithm, which should be
specified either by the algorithm's priority or algo name.  This is
expected to be called after corresponding algorithm is selected via
comp_algorithm or recomp_algorithm.

 echo "priority=0 level=1" > /sys/block/zram0/algorithm_params
or
 echo "algo=zstd level=1" > /sys/block/zram0/algorithm_params

Link: https://lkml.kernel.org/r/20240902105656.1383858-16-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nick Terrell <terrelln@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/ABI/testing/sysfs-block-zram
Documentation/admin-guide/blockdev/zram.rst
drivers/block/zram/zram_drv.c