Re: [PATCH -next v7 4/4] mm/zswap: delay the initializaton of zswap

From: Christoph Hellwig
Date: Sun Mar 26 2023 - 19:29:24 EST


> @@ -1480,11 +1500,14 @@ static int __init zswap_debugfs_init(void)
> /*********************************
> * module init and exit
> **********************************/
> -static int __init init_zswap(void)
> +static int zswap_setup(void)
> {
> struct zswap_pool *pool;
> int ret;
>
> + if (zswap_init_state != ZSWAP_UNINIT)
> + return 0;

I feel like doing this in zswap_enabled_param_set would be a lot cleaner.
With that we could do a switch on the possible enum values for
zswap_init_state there, and that is a good way to explain the possible
outcomes.