On Fri, May 31, 2024 at 03:34:44PM +0900, Sergey Senozhatsky wrote: > > So passing "raw" algorithm parameters to crypto_scomp_setparam(tfm) can be > suboptimal, depending on the compression driver. For instance, for zstd > (what is currently done in zram [1]) we pre-process "raw" parameters: > parse dictionary in order to get zstd_cdict and zstd_ddict which are then > shared by all tfm-s (as they access C/D dictionaries in read-only mode). > For zram/zswap doing this per-tfm would result in extra per-CPU > zstd_cdict/zstd_ddict allocations, which is a significant overhead. If they share the dictionary, why can't they just share the tfm directly? Or do you actually need to vary the other parameters while keeping the dictionary the same? Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt