linux/arch
Yosry Ahmed 7a2369b74a mm: z3fold: deprecate CONFIG_Z3FOLD
The z3fold compressed pages allocator is rarely used, most users use
zsmalloc.  The only disadvantage of zsmalloc in comparison is the
dependency on MMU, and zbud is a more common option for !MMU as it was the
default zswap allocator for a long time.

Historically, zsmalloc had worse latency than zbud and z3fold but offered
better memory savings.  This is no longer the case as shown by a simple
recent analysis [1].  That analysis showed that z3fold does not have any
advantage over zsmalloc or zbud considering both performance and memory
usage.  In a kernel build test on tmpfs in a limited cgroup, z3fold took
3% more time and used 1.8% more memory.  The latency of zswap_load() was
7% higher, and that of zswap_store() was 10% higher.  Zsmalloc is better
in all metrics.

Moreover, z3fold apparently has latent bugs, which was made noticeable by
a recent soft lockup bug report with z3fold [2].  Switching to zsmalloc
not only fixed the problem, but also reduced the swap usage from 6~8G to
1~2G.  Other users have also reported being bitten by mistakenly enabling
z3fold.

Other than hurting users, z3fold is repeatedly causing wasted engineering
effort.  Apart from investigating the above bug, it came up in multiple
development discussions (e.g.  [3]) as something we need to handle, when
there aren't any legit users (at least not intentionally).

The natural course of action is to deprecate z3fold, and remove in a few
cycles if no objections are raised from active users.  Next on the list
should be zbud, as it offers marginal latency gains at the cost of huge
memory waste when compared to zsmalloc.  That one will need to wait until
zsmalloc does not depend on MMU.

Rename the user-visible config option from CONFIG_Z3FOLD to
CONFIG_Z3FOLD_DEPRECATED so that users with CONFIG_Z3FOLD=y get a new
prompt with explanation during make oldconfig.  Also, remove
CONFIG_Z3FOLD=y from defconfigs.

[1]https://lore.kernel.org/lkml/CAJD7tkbRF6od-2x_L8-A1QL3=2Ww13sCj4S3i4bNndqF+3+_Vg@mail.gmail.com/
[2]https://lore.kernel.org/lkml/EF0ABD3E-A239-4111-A8AB-5C442E759CF3@gmail.com/
[3]https://lore.kernel.org/lkml/CAJD7tkbnmeVugfunffSovJf9FAgy9rhBVt_tx=nxUveLUfqVsA@mail.gmail.com/

[arnd@arndb.de: deprecate ZSWAP_ZPOOL_DEFAULT_Z3FOLD as well]
  Link: https://lkml.kernel.org/r/20240909202625.1054880-1-arnd@kernel.org
Link: https://lkml.kernel.org/r/20240904233343.933462-1-yosryahmed@google.com
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Chris Down <chris@chrisdown.name>
Acked-by: Nhat Pham <nphamcs@gmail.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Vitaly Wool <vitaly.wool@konsulko.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Aneesh Kumar K.V <aneesh.kumar@kernel.org>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N. Rao <naveen.n.rao@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-09-17 01:07:00 -07:00
..
alpha mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
arc mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
arm mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
arm64 mm/arm64: support large pfn mappings 2024-09-17 01:07:00 -07:00
csky mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
hexagon mm: remove legacy install_special_mapping() code 2024-09-01 20:26:13 -07:00
loongarch mm: z3fold: deprecate CONFIG_Z3FOLD 2024-09-17 01:07:00 -07:00
m68k Kbuild updates for v6.11 2024-07-23 14:32:21 -07:00
microblaze microblaze: don't treat zero reserved memory regions as error 2024-08-25 15:26:30 -07:00
mips mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
nios2 mm: remove legacy install_special_mapping() code 2024-09-01 20:26:13 -07:00
openrisc openrisc: convert to generic syscall table 2024-07-10 14:23:38 +02:00
parisc mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
powerpc mm: z3fold: deprecate CONFIG_Z3FOLD 2024-09-17 01:07:00 -07:00
riscv arch, mm: move definition of node_data to generic code 2024-09-03 21:15:28 -07:00
s390 s390/pci_mmio: use follow_pfnmap API 2024-09-17 01:06:59 -07:00
sh mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
sparc mm: always define pxx_pgprot() 2024-09-17 01:06:59 -07:00
um minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
x86 mm/x86: support large pfn mappings 2024-09-17 01:06:59 -07:00
xtensa mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
.gitignore
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-17 12:57:03 -07:00