]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/zswap: replace zswap_init_{started/failed} with zswap_init_state
authorLiu Shixin <liushixin2@huawei.com>
Thu, 25 Aug 2022 14:20:35 +0000 (22:20 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 26 Aug 2022 05:03:31 +0000 (22:03 -0700)
commitcc5d16aeece90c873680b05c1a80a53df082a06e
tree3672425760d9df5bfec30d36655ef5dfac8080dc
parent3812b216599e54166fafc3b7059d4edb407e4e2d
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>
mm/zswap.c