mbox series

[-next,v8,0/3] Delay the initialization of zswap

Message ID 20230403121318.1876082-1-liushixin2@huawei.com (mailing list archive)
Headers show
Series Delay the initialization of zswap | expand

Message

Liu Shixin April 3, 2023, 12:13 p.m. UTC
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.

v7->v8: Do some cleanup. And remove the second patch in v7 which is unrelated
	to the initialization of zswap.
v6->v7: Add two new patch[1,3] to cleanup the code. And cover zswap_init_*
	parameter by zswap_init_lock to protect against conflicts.
v5->v6: Simplify the code and delete the patches about frontswap suggested
	by Christoph.

Liu Shixin (3):
  mm/zswap: remove zswap_entry_cache_{create,destroy} helper function
  mm/zswap: replace zswap_init_{started/failed} with zswap_init_state
  mm/zswap: delay the initialization of zswap

 mm/zswap.c | 111 ++++++++++++++++++++++++++++++++---------------------
 1 file changed, 68 insertions(+), 43 deletions(-)