Re: [PATCH v5 02/12] crypto: acomp - Define new interfaces for compress/decompress batching.
From: Sergey Senozhatsky
Date: Sat Feb 22 2025 - 20:57:48 EST
On (25/02/23 08:24), Herbert Xu wrote:
> On Sat, Feb 22, 2025 at 09:31:41PM +0900, Sergey Senozhatsky wrote:
> >
> > The idea behind zram's code is that incompressible pages are not unusual,
> > they are quite usual, in fact, It's not necessarily that the data grew
> > in size after compression, the data is incompressible from zsmalloc PoV.
> > That is the algorithm wasn't able to compress a PAGE_SIZE buffer to an
> > object smaller than zsmalloc's huge-class-watermark (around 3600 bytes,
> > depending on zspage chain size). That's why we look at the comp-len.
> > Anything else is an error, perhaps a pretty catastrophic error.
>
> If you're rejecting everything above the watermark then you should
> simply pass the watermark as the output length to the algorithm so
> that it can stop doing useless work once it gets past that point.
Makes sense.