zswap: change zswap's default allocator to zsmalloc
authorNhat Pham <nphamcs@gmail.com>
Fri, 8 Sep 2023 23:51:15 +0000 (16:51 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 4 Oct 2023 17:32:20 +0000 (10:32 -0700)
commit64d4d49c5f3bd9a8a24f52d1e9d16af1b368114b
treea7f061b35f39441cf748be25847b525bd25773fd
parent7b709f38dc0faf0d6dfeff681e37e59f9aabebd6
zswap: change zswap's default allocator to zsmalloc

Out of zswap's 3 allocators, zsmalloc is the clear superior in terms of
memory utilization, both in theory and as observed in practice, with its
high storage density and low internal fragmentation.  zsmalloc is also
more actively developed and maintained, since it is the allocator of
choice for zswap for many users, as well as the only allocator for zram.

A historical objection to the selection of zsmalloc as the default
allocator for zswap is its lack of writeback capability.  However, this
has changed, with the zsmalloc writeback patchset, and the subsequent
zswap LRU refactor.  With this, there is not a lot of good reasons to keep
zbud, an otherwise inferior allocator, as the default instead of zswap.

This patch changes the default allocator to zsmalloc.  The only exception
is on settings without MMU, in which case zbud will remain as the default.

Link: https://lkml.kernel.org/r/20230908235115.2943486-1-nphamcs@gmail.com
Signed-off-by: Nhat Pham <nphamcs@gmail.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Yosry Ahmed <yosryahmed@google.com>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Domenico Cerasuolo <cerasuolodomenico@gmail.com>
Cc: Seth Jennings <sjenning@redhat.com>
Cc: Vitaly Wool <vitaly.wool@konsulko.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/Kconfig