On (24/05/06 16:58), Sergey Senozhatsky wrote: > This patch set moves zram from crypto API to a custom compression > API which allows us to tune and configure compression algorithms, > something that crypto API, unfortunately, doesn't support. Basically, > this seroes brings back the bits of comp "backend" code that we had > many years ago. This means that if we want zram to support new > compression algorithms we need to implement corresponding backends. > > Currently, zram supports a pretty decent number of comp backends: > lzo, lzorle, lz4, lz4hc, 842, deflate, zstd > > At this point we handle 2 parameters: a compression level and > a pre-trained compression dictionary. Which seems like a good enough > start. The list will be extended in the future. > > Examples: > > - changes default compression level > echo "algo=zstd level=11" > /sys/block/zram0/comp_algorithm > > - passes path to a pre-trained dictionary > echo "algo=zstd dict=/etc/dictionary" > /sys/block/zram0/comp_algorithm I'll send v3 shortly, which adds pre-trained dictionary support to lz4 and lz4hc compression backends. Apparently lz4/lz4hc can use dictionaries pre-trained with zstd --init, just like zstd.