]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm: zswap: interact directly with zsmalloc
authorJohannes Weiner <hannes@cmpxchg.org>
Fri, 29 Aug 2025 16:15:26 +0000 (17:15 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 21 Sep 2025 21:21:58 +0000 (14:21 -0700)
commit5c3f8be0c6b1a7b145a5db012b427c25516564c4
treedb46d98b5ea42d0a45de3d3ad6db3fb3643cb93a
parente45085f2673b165687a3874d8e868437683fa8e4
mm: zswap: interact directly with zsmalloc

Patch series "mm: remove zpool".

zpool is an indirection layer for zswap to switch between multiple
allocator backends at runtime.  Since 6.15, zsmalloc is the only allocator
left in-tree, so there is no point in keeping zpool around.

This patch (of 3):

zswap goes through the zpool layer to enable runtime-switching of
allocator backends for compressed data.  However, since zbud and z3fold
were removed in 6.15, zsmalloc has been the only option available.

As such, the zpool indirection is unnecessary.  Make zswap deal with
zsmalloc directly.  This is comparable to zram, which also directly
interacts with zsmalloc and has never supported a different backend.

Note that this does not preclude future improvements and experiments with
different allocation strategies.  Should it become necessary, it's
possible to provide an alternate implementation for the zsmalloc API,
selectable at compile time.  However, zsmalloc is also rather mature and
feature rich, with years of widespread production exposure; it's
encouraged to make incremental improvements rather than fork it.

In any case, the complexity of runtime pluggability seems excessive and
unjustified at this time.  Switch zswap to zsmalloc to remove the last
user of the zpool API.

[hannes@cmpxchg.org: fix default compressr test]
Link: https://lkml.kernel.org/r/20250915153640.GA828739@cmpxchg.org
Link: https://lkml.kernel.org/r/20250829162212.208258-1-hannes@cmpxchg.org
Link: https://lkml.kernel.org/r/20250829162212.208258-2-hannes@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Nacked-by: Vitaly Wool <vitaly.wool@konsulko.se>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Acked-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Cc: Chengming Zhou <zhouchengming@bytedance.com>
Cc: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/zswap.c