Re: [PATCH v3] zram: break the strict dependency from lzo

From: Sergey Senozhatsky
Date: Wed Oct 28 2020 - 18:26:44 EST


Hi,

On (20/10/28 11:25), Rui Salvaterra wrote:
> > diff --git a/drivers/block/zram/Kconfig b/drivers/block/zram/Kconfig
> > index fe7a4b7d30cf..f93eed40e155 100644
> > --- a/drivers/block/zram/Kconfig
> > +++ b/drivers/block/zram/Kconfig
> > @@ -2,7 +2,7 @@
> > config ZRAM
> > tristate "Compressed RAM block device support"
> > depends on BLOCK && SYSFS && ZSMALLOC && CRYPTO
> > - select CRYPTO_LZO
> > + depends on (CRYPTO_LZO || CRYPTO_LZ4 || CRYPTO_LZ4HC || CRYPTO_842 || CRYPTO_ZSTD)
>
> This reverses the dependency order, as now we have to select a
> supported compression algorithm in order for zram to be visible in the
> block device drivers list.

Right, but well we also need to select ZSMALLOC and CRYPTO for
zram to become visible (the thing that I found out recently is
that you can always check the hidden/blocked items by hitting
'z' in menuconfig).

> This is why I wrote the ZRAM_AUTOSEL_ALGO
> kconfig symbol, which automatically selects lzo as a fallback. If the
> user chooses to select another supported algorithm, he will then be
> allowed to deselect lzo. We thus follow the principle of least
> surprise, IMHO.

OK, makes sense.

-ss