Re: [PATCH v2 4/8] zram: use crypto api to check alg availability

From: Minchan Kim
Date: Tue May 31 2016 - 22:26:36 EST


On Wed, Jun 01, 2016 at 10:07:07AM +0900, Sergey Senozhatsky wrote:
> Hello Minchan,
>
> On (06/01/16 09:03), Minchan Kim wrote:
> [..]
> > So, if we do 'cat /sys/block/zram0/comp_algorithm", every crypto modules
> > in the backend array are loaded in memory and not unloaded until admin
> > executes rmmod? Right?
>
> yes, I think so.

It scares me. Common case, except one we choosed, every loaded modules
will be not used. I think it's really not good. Although the wastage
might be not big now, it will be heavy as crypto comp modules are
increased.

What do you think about it?

>
> [..]
> > If user load out-of-tree crypto compression module, what's status of
> > comp_algorithm?
> >
> > #> insmod foo_crypto.ko
> > #> echo foo > /sys/block/zram0/comp_algorithm
> > #> cat /sys/block/zram0/comp_algorithm
> > lzo lz4 [foo]
> > ?
>
> yes, "lzo lz4 [out-of-tree-module-name]".

Makes sense!