]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lib: zstd: export API needed for dictionary support
authorSergey Senozhatsky <senozhatsky@chromium.org>
Fri, 12 Jul 2024 05:18:12 +0000 (14:18 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:52:26 +0000 (17:52 -0700)
commit758632dc6ab56fa594c07322773a744642dc5e3f
tree97ade07f347085ddab5184eb5466c0721f9ffc01
parentd4768aa929809bf8ac4bf252abfddfe044134743
lib: zstd: export API needed for dictionary support

Patch series "zram: introduce custom comp backends API", v6.

This series introduces support for run-time compression algorithms tuning,
so users, for instance, can adjust compression/acceleration levels and
provide pre-trained compression/decompression dictionaries which certain
algorithms support.

At this point we stop supporting (old/deprecated) comp API.  We may add
new acomp API support in the future, but before that zram needs to undergo
some major rework (we are not ready for async compression).

Some benchmarks for reference (look at column #2)

*** zstd
/sys/block/zram0/mm_stat
1750650880 504575194 514392064        0 514392064        1        0    34204    34204

*** zstd level=-1
/sys/block/zram0/mm_stat
1750638592 591816152 603758592        0 603758592        1        0    34288    34288

*** zstd level=8
/sys/block/zram0/mm_stat
1750659072 486924248 496377856        0 496377856        1        0    34204    34204

*** zstd dict=/home/ss/zstd-dict-amd64
/sys/block/zram0/mm_stat
1750634496 465853994 475230208        0 475230208        1        0    34185    34185

*** zstd level=8 dict=/home/ss/zstd-dict-amd64
/sys/block/zram0/mm_stat
1750650880 430760956 439967744        0 439967744        1        0    34185    34185

*** lz4
/sys/block/zram0/mm_stat
1750663168 664194239 676970496        0 676970496        1        0    34288    34288

*** lz4 dict=/home/ss/lz4-dict-amd64
/sys/block/zram0/mm_stat
1750650880 619901052 632061952        0 632061952        1        0    34278    34278

*** lz4 level=5 dict=/home/ss/lz4-dict-amd64
/sys/block/zram0/mm_stat
1750650880 727180082 740884480        0 740884480        1        0    34438    34438

This patch (of 6):

We need to export a number of API functions that enable advanced zstd
usage - C/D dictionaries, dictionaries sharing between contexts, etc.

Link: https://lkml.kernel.org/r/20240712051850.484318-1-senozhatsky@chromium.org
Link: https://lkml.kernel.org/r/20240712051850.484318-2-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/zstd.h
lib/zstd/zstd_compress_module.c
lib/zstd/zstd_decompress_module.c