+ mm-zbud-deprecate-config_zbud.patch added to mm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm: zbud: deprecate CONFIG_ZBUD
has been added to the -mm mm-unstable branch.  Its filename is
     mm-zbud-deprecate-config_zbud.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-zbud-deprecate-config_zbud.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Yosry Ahmed <yosry.ahmed@xxxxxxxxx>
Subject: mm: zbud: deprecate CONFIG_ZBUD
Date: Mon, 27 Jan 2025 23:58:21 +0000

Patch series "mm: zswap: deprecate zbud and remove z3fold".

After 2 cycles of deprecating z3fold, remove it and mark zbud as
deprecated for removal next.  It was initially thought that zbud cannot be
removed because it has no dependency on CONFIG_MMU while zsmalloc does,
but CONFIG_SWAP depends on CONFIG_MMU anyway.


This patch (of 2):

The zbud compressed pages allocator is rarely used, most users use
zsmalloc.  zbud consumes much more memory (only stores 1 or 2 compressed
pages per physical page).  The only advantage of zbud is a marginal
performance improvement that by no means justify the memory overhead.

Historically, zsmalloc had significantly 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].  In a kernel build test on tmpfs in
a limited cgroup, zbud 2-3% less time than zsmalloc, but at the cost of
using ~32% more memory (1.5G vs 1.13G).  The tradeoff does not make sense
for zbud in any practical scenario.

The only alleged advantage of zbud is not having the dependency on
CONFIG_MMU, but CONFIG_SWAP already depends on CONFIG_MMU anyway, and zbud
is only used by zswap.

Following in the footsteps of [2], which deprecated z3fold, deprecated
zbud as planned and remove it in a few cycles if no objections are raised
from active users.

Rename the user-visible config options so that users with CONFIG_ZBUD=y
get a new prompt with explanation during make oldconfig.  Also, remove
CONFIG_ZBUD from defconfig.

[1]https://lore.kernel.org/lkml/CAJD7tkbRF6od-2x_L8-A1QL3=2Ww13sCj4S3i4bNndqF+3+_Vg@xxxxxxxxxxxxxx/
[2]https://lore.kernel.org/lkml/20240904233343.933462-1-yosryahmed@xxxxxxxxxx/

Link: https://lkml.kernel.org/r/Z5gdlO5pOu9XeGce@xxxxxxxxxx
Link: https://lkml.kernel.org/r/Z5gdnSX5Lv-nfjQL@xxxxxxxxxx
Signed-off-by: Yosry Ahmed <yosry.ahmed@xxxxxxxxx>
Cc: Chengming Zhou <chengming.zhou@xxxxxxxxx>
Cc: Huacai Chen <chenhuacai@xxxxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxx>
Cc: linmiaohe <linmiaohe@xxxxxxxxxx>
Cc: Nhat Pham <nphamcs@xxxxxxxxx>
Cc: Vitaly Wool <vitaly.wool@xxxxxxxxxxxx>
Cc: WANG Xuerui <kernel@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 arch/loongarch/configs/loongson3_defconfig |    3 --
 mm/Kconfig                                 |   26 +++++++++++++------
 2 files changed, 20 insertions(+), 9 deletions(-)

--- a/arch/loongarch/configs/loongson3_defconfig~mm-zbud-deprecate-config_zbud
+++ a/arch/loongarch/configs/loongson3_defconfig
@@ -109,8 +109,7 @@ CONFIG_BINFMT_MISC=m
 CONFIG_ZPOOL=y
 CONFIG_ZSWAP=y
 CONFIG_ZSWAP_COMPRESSOR_DEFAULT_ZSTD=y
-CONFIG_ZBUD=y
-CONFIG_ZSMALLOC=m
+CONFIG_ZSMALLOC=y
 # CONFIG_COMPAT_BRK is not set
 CONFIG_MEMORY_HOTPLUG=y
 # CONFIG_MHP_DEFAULT_ONLINE_TYPE_OFFLINE is not set
--- a/mm/Kconfig~mm-zbud-deprecate-config_zbud
+++ a/mm/Kconfig
@@ -129,7 +129,6 @@ choice
 	prompt "Default allocator"
 	depends on ZSWAP
 	default ZSWAP_ZPOOL_DEFAULT_ZSMALLOC if MMU
-	default ZSWAP_ZPOOL_DEFAULT_ZBUD
 	help
 	  Selects the default allocator for the compressed cache for
 	  swap pages.
@@ -140,12 +139,15 @@ choice
 	  The selection made here can be overridden by using the kernel
 	  command line 'zswap.zpool=' option.
 
-config ZSWAP_ZPOOL_DEFAULT_ZBUD
-	bool "zbud"
-	select ZBUD
+config ZSWAP_ZPOOL_DEFAULT_ZBUD_DEPRECATED
+	bool "zbud (DEPRECATED)"
+	select ZBUD_DEPRECATED
 	help
 	  Use the zbud allocator as the default allocator.
 
+	  Deprecated and scheduled for removal in a few cycles,
+	  see CONFIG_ZBUD_DEPRECATED.
+
 config ZSWAP_ZPOOL_DEFAULT_Z3FOLD_DEPRECATED
 	bool "z3foldi (DEPRECATED)"
 	select Z3FOLD_DEPRECATED
@@ -165,21 +167,31 @@ endchoice
 config ZSWAP_ZPOOL_DEFAULT
        string
        depends on ZSWAP
-       default "zbud" if ZSWAP_ZPOOL_DEFAULT_ZBUD
+       default "zbud" if ZSWAP_ZPOOL_DEFAULT_ZBUD_DEPRECATED
        default "z3fold" if ZSWAP_ZPOOL_DEFAULT_Z3FOLD_DEPRECATED
        default "zsmalloc" if ZSWAP_ZPOOL_DEFAULT_ZSMALLOC
        default ""
 
-config ZBUD
-	tristate "2:1 compression allocator (zbud)"
+config ZBUD_DEPRECATED
+	tristate "2:1 compression allocator (zbud) (DEPRECATED)"
 	depends on ZSWAP
 	help
+	  Deprecated and scheduled for removal in a few cycles. If you have
+	  a good reason for using ZBUD over ZSMALLOC, please contact
+	  linux-mm@xxxxxxxxx and the zswap maintainers.
+
 	  A special purpose allocator for storing compressed pages.
 	  It is designed to store up to two compressed pages per physical
 	  page.  While this design limits storage density, it has simple and
 	  deterministic reclaim properties that make it preferable to a higher
 	  density approach when reclaim will be used.
 
+config ZBUD
+	tristate
+	default y if ZBUD_DEPRECATED=y
+	default m if ZBUD_DEPRECATED=m
+	depends on ZBUD_DEPRECATED
+
 config Z3FOLD_DEPRECATED
 	tristate "3:1 compression allocator (z3fold) (DEPRECATED)"
 	depends on ZSWAP
_

Patches currently in -mm which might be from yosry.ahmed@xxxxxxxxx are

maintainers-mailmap-update-yosry-ahmeds-email-address.patch
mm-zbud-deprecate-config_zbud.patch
mm-z3fold-remove-z3fold.patch





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux