mm-zbud-remove-zbud.patch removed from -mm tree
The quilt patch titled
Subject: mm: zbud: remove zbud
has been removed from the -mm tree. Its filename was
mm-zbud-remove-zbud.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Yosry Ahmed <[email protected]>
Subject: mm: zbud: remove zbud
Date: Wed, 29 Jan 2025 18:06:32 +0000
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.
Remove zbud after z3fold's removal, leaving zsmalloc as the one and only zpool allocator. Leave the removal of the zpool API (and its associated config options) to a followup cleanup after no more allocators show up.
Deprecating zbud for a few cycles before removing it was initially proposed [2], like z3fold was marked as deprecated for 2 cycles [3]. However, Johannes rightfully pointed out that the 2 cycles is too short for most downstream consumers, and z3fold was deprecated first only as a courtesy anyway.
[1]https://lore.kernel.org/lkml/CAJD7tkbRF6od-2x_L8-A1QL3=2Ww13sCj4S3i4bNndqF+3+_Vg@mail.gmail.com/ [2]https://lore.kernel.org/lkml/[email protected]/ [3]https://lore.kernel.org/lkml/[email protected]/
---
CREDITS | 2 Documentation/admin-guide/mm/zswap.rst | 10 MAINTAINERS | 7 arch/loongarch/configs/loongson3_defconfig | 3 arch/s390/configs/debug_defconfig | 2 arch/s390/configs/defconfig | 2 include/linux/zpool.h | 5 mm/Kconfig | 18 mm/Makefile | 1 mm/zbud.c | 455 ------------------- mm/zpool.c | 4 11 files changed, 13 insertions(+), 496 deletions(-)
arch/loongarch/configs/loongson3_defconfig renamed from arch/loongarch/configs/loongson3_defconfig~mm-zbud-remove-zbud +1 -2
@@ -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
arch/s390/configs/debug_defconfig renamed from arch/s390/configs/debug_defconfig~mm-zbud-remove-zbud +1 -1
@@ -92,7 +92,7 @@ CONFIG_UNIXWARE_DISKLABEL=y CONFIG_IOSCHED_BFQ=y CONFIG_BINFMT_MISC=m CONFIG_ZSWAP=y -CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y +CONFIG_ZSMALLOC=y CONFIG_ZSMALLOC_STAT=y CONFIG_SLAB_BUCKETS=y CONFIG_SLUB_STATS=y
arch/s390/configs/defconfig renamed from arch/s390/configs/defconfig~mm-zbud-remove-zbud +1 -1
@@ -86,7 +86,7 @@ CONFIG_UNIXWARE_DISKLABEL=y CONFIG_IOSCHED_BFQ=y CONFIG_BINFMT_MISC=m CONFIG_ZSWAP=y -CONFIG_ZSWAP_ZPOOL_DEFAULT_ZBUD=y +CONFIG_ZSMALLOC=y CONFIG_ZSMALLOC_STAT=y CONFIG_SLAB_BUCKETS=y # CONFIG_COMPAT_BRK is not set
CREDITS renamed from CREDITS~mm-zbud-remove-zbud +2 -0
@@ -1895,6 +1895,7 @@ S: Czech Republic N: Seth Jennings E: [email protected] D: Creation and maintenance of zswap +D: Creation and maintenace of the zbud allocator N: Jeremy Kerr D: Maintainer of SPU File System
@@ -3788,6 +3789,7 @@ N: Dan Streetman E: [email protected] D: Maintenance and development of zswap D: Creation and maintenance of the zpool API +D: Maintenace of the zbud allocator N: Drew Sullivan E: [email protected]
Documentation/admin-guide/mm/zswap.rst renamed from Documentation/admin-guide/mm/zswap.rst~mm-zbud-remove-zbud +4 -6
@@ -60,15 +60,13 @@ accessed. The compressed memory pool gr pages are freed. The pool is not preallocated. By default, a zpool of type selected in ``CONFIG_ZSWAP_ZPOOL_DEFAULT`` Kconfig option is created, but it can be overridden at boot time by setting the ``zpool`` attribute, -e.g. ``zswap.zpool=zbud``. It can also be changed at runtime using the sysfs +e.g. ``zswap.zpool=zsmalloc``. It can also be changed at runtime using the sysfs ``zpool`` attribute, e.g.:: - echo zbud > /sys/module/zswap/parameters/zpool + echo zsmalloc > /sys/module/zswap/parameters/zpool -The zbud type zpool allocates exactly 1 page to store 2 compressed pages, which -means the compression ratio will always be 2:1 or worse (because of half-full -zbud pages). The zsmalloc type zpool has a more complex compressed page -storage method, and it can achieve greater storage densities. +The zsmalloc type zpool has a complex compressed page storage method, and it +can achieve great storage densities. When a swap page is passed from swapout to zswap, zswap maintains a mapping of the swap entry, a combination of the swap type and swap offset, to the zpool
include/linux/zpool.h renamed from include/linux/zpool.h~mm-zbud-remove-zbud +2 -3
@@ -4,9 +4,8 @@* * Copyright (C) 2014 Dan Streetman * -* This is a common frontend for the zbud and zsmalloc memory -* storage pool implementations. Typically, this is used to -* store compressed memory. +* This is a common frontend for the zswap compressed memory storage +* implementations. */ #ifndef _ZPOOL_H_
MAINTAINERS renamed from MAINTAINERS~mm-zbud-remove-zbud +0 -7
@@ -26191,13 +26191,6 @@ F: Documentation/networking/device_drive F: drivers/net/hamradio/*scc.c F: drivers/net/hamradio/z8530.h -ZBUD COMPRESSED PAGE ALLOCATOR -M: Seth Jennings <[email protected]> -M: Dan Streetman <[email protected]> -L: [email protected] -S: Maintained -F: mm/zbud.c - ZD1211RW WIRELESS DRIVER L: [email protected] S: Orphan
mm/Kconfig renamed from mm/Kconfig~mm-zbud-remove-zbud +0 -18
@@ -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,6 @@ 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 - help - Use the zbud allocator as the default allocator. - config ZSWAP_ZPOOL_DEFAULT_ZSMALLOC bool "zsmalloc" select ZSMALLOC
@@ -156,20 +149,9 @@ endchoice config ZSWAP_ZPOOL_DEFAULT string depends on ZSWAP - default "zbud" if ZSWAP_ZPOOL_DEFAULT_ZBUD default "zsmalloc" if ZSWAP_ZPOOL_DEFAULT_ZSMALLOC default "" -config ZBUD - tristate "2:1 compression allocator (zbud)" - depends on ZSWAP - help - 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 ZSMALLOC tristate prompt "N:1 compression allocator (zsmalloc)" if (ZSWAP || ZRAM)
mm/Makefile renamed from mm/Makefile~mm-zbud-remove-zbud +0 -1
@@ -113,7 +113,6 @@ obj-$(CONFIG_DEBUG_VM_PGTABLE) += debug_ obj-$(CONFIG_PAGE_OWNER) += page_owner.o obj-$(CONFIG_MEMORY_ISOLATION) += page_isolation.o obj-$(CONFIG_ZPOOL) += zpool.o -obj-$(CONFIG_ZBUD) += zbud.o obj-$(CONFIG_ZSMALLOC) += zsmalloc.o obj-$(CONFIG_GENERIC_EARLY_IOREMAP) += early_ioremap.o obj-$(CONFIG_CMA) += cma.o
mm/zbud.c deleted +0 -455
455 lines not on this page · raw message
mm/zpool.c renamed from mm/zpool.c~mm-zbud-remove-zbud +2 -2
@@ -95,7 +95,7 @@ static void zpool_put_driver(struct zpoo/** * zpool_has_pool() - Check if the pool driver is available -* @type: The type of the zpool to check (e.g. zbud, zsmalloc) +* @type: The type of the zpool to check (e.g. zsmalloc) * * This checks if the @type pool driver is available. This will try to load * the requested module, if needed, but there is no guarantee the module will
@@ -130,7 +130,7 @@ EXPORT_SYMBOL(zpool_has_pool);/** * zpool_create_pool() - Create a new zpool -* @type: The type of the zpool to create (e.g. zbud, zsmalloc) +* @type: The type of the zpool to create (e.g. zsmalloc) * @name: The name of the zpool (e.g. zram0, zswap) * @gfp: The GFP flags to use when allocating the pool. *
_
Patches currently in -mm which might be from [email protected] are