diff options
author | Chengming Zhou <chengming.zhou@linux.dev> | 2024-03-05 07:53:45 +0000 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-03-06 13:04:18 -0800 |
commit | e35606e4167dd55d48aa6232c074137577818add (patch) | |
tree | 36af510b5501a691237289c500e69cbb59558cc8 /lib/stmp_device.c | |
parent | 5aa598a72eafcf05239519646ec88638c8894dba (diff) | |
download | linux-e35606e4167dd55d48aa6232c074137577818add.tar.gz linux-e35606e4167dd55d48aa6232c074137577818add.tar.bz2 linux-e35606e4167dd55d48aa6232c074137577818add.zip |
mm/zswap: global lru and shrinker shared by all zswap_pools fix
Commit bf9b7df23cb3 ("mm/zswap: global lru and shrinker shared by all
zswap_pools") introduced a new lock to protect zswap_next_shrink, instead
of reusing zswap_pools_lock.
But the problem is that it's initialized only when zswap enabled, which
causes bug if zswap_memcg_offline_cleanup() called without zswap enabled.
Fix it by using DEFINE_SPINLOCK() to statically initialize them and define
them as multiple static variables to keep in consistent with the existing
global variables in zswap.
Link: https://lkml.kernel.org/r/20240305075345.1493214-1-chengming.zhou@linux.dev
Fixes: bf9b7df23cb3 ("mm/zswap: global lru and shrinker shared by all zswap_pools")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202403051008.a8cf8a94-lkp@intel.com
Signed-off-by: Chengming Zhou <chengming.zhou@linux.dev>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib/stmp_device.c')
0 files changed, 0 insertions, 0 deletions