Re: [PATCH -next v9 0/3] Delay the initialization of zswap

Liu Shixin
2023-05-04T07:11:14Z

On 2023/5/4 8:11, Chris Li wrote:
> Hi Shixing,
>
> On Tue, Apr 11, 2023 at 05:36:29PM +0800, Liu Shixin wrote:
>> In the initialization of zswap, about 18MB memory will be allocated for
>> zswap_pool. Since some users may not use zswap, the zswap_pool is wasted.
>> Save memory by delaying the initialization of zswap until enabled.
> Sorry I am late to this discussion. I notice you are already at V9.
> Anyway, I am curious how much of the 18MB was came from the zswap_pool
> alone and how much of it came from the other part of the initialization.
>
> If it is the zswap_pool alone, it means that we can have a smaller patch
> to get most of your 18M back.
You're right, the most came from zswap_pool.
>
> I also notice you move a lot of __init function back to normal functions.
> That would mean those functions wouldn't be able to drop after the
> initialization phase. That is another reason to move less of the initialization
> function.
Thanks for your advice. I've thought about it before, but I thought there is less impact
for the size of kernel, so I didn't do it.
>
> Chris
>
> .
>