mm/zswap: replace zswap_init_{started/failed} with zswap_init_state
Patch series "Delay the initializaton of zswap".
In the initialization of zswap, about 18MB memory will be allocated for
zswap_pool. Since not all users use zswap, the memory may be wasted.
Save the memory for these users by delaying the initialization of zswap to
first enablement.
This patch (of 3):
zswap_init_started indicates that the initialization is started. And
zswap_init_failed indicates that the initialization is failed. As we will
support to init zswap after system startup, it's necessary to add a state
to indicate the initialization is complete and succeed to avoid
concurrency issues. Since we don't care about the difference between init
started with init completion. We only need three states: uninitialized,
initial failed, initial succeed.
Link: https://lkml.kernel.org/r/20220825142037.3214152-1-liushixin2@huawei.com
Link: https://lkml.kernel.org/r/20220825142037.3214152-2-liushixin2@huawei.com
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Seth Jennings <sjenning@redhat.com>
Cc: Vitaly Wool <vitaly.wool@konsulko.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>