mm/zswap: delay the initialization of zswap
authorLiu Shixin <liushixin2@huawei.com>
Mon, 3 Apr 2023 12:13:18 +0000 (20:13 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 18 Apr 2023 23:29:48 +0000 (16:29 -0700)
commit141fdeececb3d7b782ea7361a22659775d53bc2a
tree21421a59991531bd16e0144a8cf3c6c52183df60
parent9021ccec60f2d86b84080a7e262c91ea99495eaa
mm/zswap: delay the initialization of zswap

Since some users may not use zswap, the zswap_pool is wasted.  Save memory
by delaying the initialization of zswap until enabled.

[liushixin2@huawei.com: fix some pattern problem suggested by Christoph]
Link: https://lkml.kernel.org/r/20230411093632.822290-4-liushixin2@huawei.com
Link: https://lkml.kernel.org/r/20230403121318.1876082-4-liushixin2@huawei.com
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Nathan Chancellor <nathan@kernel.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