mbox series

[0/2] pstore: Replace crypto API compression with zlib calls

Message ID 20230704135211.2471371-1-ardb@kernel.org (mailing list archive)
Headers show
Series pstore: Replace crypto API compression with zlib calls | expand

Message

Ard Biesheuvel July 4, 2023, 1:52 p.m. UTC
The pstore layer implements support for compression of kernel log
output, using a variety of compressions algorithms provided by the
[deprecated] crypto API 'comp' interface.

This appears to have been somebody's pet project rather than a solution
to a real problem: the original deflate compression is reasonably fast,
compressed well and is comparatively small in terms of code footprint,
and so the flexibility that the crypto API integration provides does
little more than complicate the code for no reason.

So let's get rid of this complexity, and switch back to zlib deflate
using the library interface.

Cc: Kees Cook <keescook@chromium.org>
Cc: "Guilherme G. Piccoli" <gpiccoli@igalia.com>

Ard Biesheuvel (1):
  pstore: Replace crypto API compression with zlib_deflate library calls

Kees Cook (1):
  pstore: Remove worst-case compression size logic

 fs/pstore/Kconfig    | 100 +-------
 fs/pstore/platform.c | 249 +++++---------------
 2 files changed, 72 insertions(+), 277 deletions(-)

Comments

Kees Cook July 4, 2023, 4:08 p.m. UTC | #1
On July 4, 2023 6:52:09 AM PDT, Ard Biesheuvel <ardb@kernel.org> wrote:
>The pstore layer implements support for compression of kernel log
>output, using a variety of compressions algorithms provided by the
>[deprecated] crypto API 'comp' interface.
>
>This appears to have been somebody's pet project rather than a solution
>to a real problem: the original deflate compression is reasonably fast,
>compressed well and is comparatively small in terms of code footprint,
>and so the flexibility that the crypto API integration provides does
>little more than complicate the code for no reason.
>
>So let's get rid of this complexity, and switch back to zlib deflate
>using the library interface.
>
>Cc: Kees Cook <keescook@chromium.org>
>Cc: "Guilherme G. Piccoli" <gpiccoli@igalia.com>

Thanks for picking this back up, it had fallen down on my to-do list. :)

>
>Ard Biesheuvel (1):
>  pstore: Replace crypto API compression with zlib_deflate library calls
>
>Kees Cook (1):
>  pstore: Remove worst-case compression size logic
>
> fs/pstore/Kconfig    | 100 +-------
> fs/pstore/platform.c | 249 +++++---------------
> 2 files changed, 72 insertions(+), 277 deletions(-)

My favorite kind of patch ratio! :)
Guilherme G. Piccoli July 4, 2023, 6:30 p.m. UTC | #2
On 04/07/2023 10:52, Ard Biesheuvel wrote:
> The pstore layer implements support for compression of kernel log
> output, using a variety of compressions algorithms provided by the
> [deprecated] crypto API 'comp' interface.
> 
> This appears to have been somebody's pet project rather than a solution
> to a real problem: the original deflate compression is reasonably fast,
> compressed well and is comparatively small in terms of code footprint,
> and so the flexibility that the crypto API integration provides does
> little more than complicate the code for no reason.
> 
> So let's get rid of this complexity, and switch back to zlib deflate
> using the library interface.

Thanks Ard, very nice stuff - makes total sense for me!

I'll test it in the Steam Deck - waiting a V2 (since there are some code
comments from Eric and Kees).

Cheers,


Guilherme