Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm, slob: rename CONFIG_SLOB to CONFIG_SLOB_DEPRECATED

As explained in [1], we would like to remove SLOB if possible.

- There are no known users that need its somewhat lower memory footprint
so much that they cannot handle SLUB (after some modifications by the
previous patches) instead.

- It is an extra maintenance burden, and a number of features are
incompatible with it.

- It blocks the API improvement of allowing kfree() on objects allocated
via kmem_cache_alloc().

As the first step, rename the CONFIG_SLOB option in the slab allocator
configuration choice to CONFIG_SLOB_DEPRECATED. Add CONFIG_SLOB
depending on CONFIG_SLOB_DEPRECATED as an internal option to avoid code
churn. This will cause existing .config files and defconfigs with
CONFIG_SLOB=y to silently switch to the default (and recommended
replacement) SLUB, while still allowing SLOB to be configured by anyone
that notices and needs it. But those should contact the slab maintainers
and linux-mm@kvack.org as explained in the updated help. With no valid
objections, the plan is to update the existing defconfigs to SLUB and
remove SLOB in a few cycles.

To make SLUB more suitable replacement for SLOB, a CONFIG_SLUB_TINY
option was introduced to limit SLUB's memory overhead.
There is a number of defconfigs specifying CONFIG_SLOB=y. As part of
this patch, update them to select CONFIG_SLUB and CONFIG_SLUB_TINY.

[1] https://lore.kernel.org/all/b35c3f82-f67b-2103-7d82-7a7ba7521439@suse.cz/

Cc: Russell King <linux@armlinux.org.uk>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Conor Dooley <conor@kernel.org>
Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi> # OMAP1
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> # riscv k210
Acked-by: Arnd Bergmann <arnd@arndb.de> # arm
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Christoph Lameter <cl@linux.com>

+52 -21
+2 -1
arch/arm/configs/clps711x_defconfig
··· 14 14 CONFIG_ARCH_P720T=y 15 15 CONFIG_AEABI=y 16 16 # CONFIG_COREDUMP is not set 17 - CONFIG_SLOB=y 17 + CONFIG_SLUB=y 18 + CONFIG_SLUB_TINY=y 18 19 CONFIG_NET=y 19 20 CONFIG_PACKET=y 20 21 CONFIG_UNIX=y
+2 -1
arch/arm/configs/collie_defconfig
··· 13 13 CONFIG_FPE_NWFPE=y 14 14 CONFIG_PM=y 15 15 # CONFIG_SWAP is not set 16 - CONFIG_SLOB=y 16 + CONFIG_SLUB=y 17 + CONFIG_SLUB_TINY=y 17 18 CONFIG_NET=y 18 19 CONFIG_PACKET=y 19 20 CONFIG_UNIX=y
+2 -1
arch/arm/configs/multi_v4t_defconfig
··· 25 25 CONFIG_JUMP_LABEL=y 26 26 CONFIG_PARTITION_ADVANCED=y 27 27 # CONFIG_COREDUMP is not set 28 - CONFIG_SLOB=y 28 + CONFIG_SLUB=y 29 + CONFIG_SLUB_TINY=y 29 30 CONFIG_MTD=y 30 31 CONFIG_MTD_CMDLINE_PARTS=y 31 32 CONFIG_MTD_BLOCK=y
+2 -1
arch/arm/configs/omap1_defconfig
··· 42 42 CONFIG_PARTITION_ADVANCED=y 43 43 CONFIG_BINFMT_MISC=y 44 44 # CONFIG_SWAP is not set 45 - CONFIG_SLOB=y 45 + CONFIG_SLUB=y 46 + CONFIG_SLUB_TINY=y 46 47 # CONFIG_VM_EVENT_COUNTERS is not set 47 48 CONFIG_NET=y 48 49 CONFIG_PACKET=y
+2 -1
arch/arm/configs/pxa_defconfig
··· 49 49 CONFIG_LDM_PARTITION=y 50 50 CONFIG_CMDLINE_PARTITION=y 51 51 CONFIG_BINFMT_MISC=y 52 - CONFIG_SLOB=y 52 + CONFIG_SLUB=y 53 + CONFIG_SLUB_TINY=y 53 54 # CONFIG_COMPACTION is not set 54 55 CONFIG_NET=y 55 56 CONFIG_PACKET=y
+2 -1
arch/arm/configs/tct_hammer_defconfig
··· 19 19 CONFIG_MODULES=y 20 20 CONFIG_MODULE_UNLOAD=y 21 21 # CONFIG_SWAP is not set 22 - CONFIG_SLOB=y 22 + CONFIG_SLUB=y 23 + CONFIG_SLUB_TINY=y 23 24 CONFIG_NET=y 24 25 CONFIG_PACKET=y 25 26 CONFIG_UNIX=y
+2 -1
arch/arm/configs/xcep_defconfig
··· 26 26 CONFIG_MODVERSIONS=y 27 27 CONFIG_MODULE_SRCVERSION_ALL=y 28 28 # CONFIG_BLOCK is not set 29 - CONFIG_SLOB=y 29 + CONFIG_SLUB=y 30 + CONFIG_SLUB_TINY=y 30 31 # CONFIG_COMPAT_BRK is not set 31 32 # CONFIG_VM_EVENT_COUNTERS is not set 32 33 CONFIG_NET=y
+2 -1
arch/openrisc/configs/or1ksim_defconfig
··· 10 10 # CONFIG_AIO is not set 11 11 # CONFIG_VM_EVENT_COUNTERS is not set 12 12 # CONFIG_COMPAT_BRK is not set 13 - CONFIG_SLOB=y 13 + CONFIG_SLUB=y 14 + CONFIG_SLUB_TINY=y 14 15 CONFIG_MODULES=y 15 16 # CONFIG_BLOCK is not set 16 17 CONFIG_OPENRISC_BUILTIN_DTB="or1ksim"
+2 -1
arch/openrisc/configs/simple_smp_defconfig
··· 16 16 # CONFIG_AIO is not set 17 17 # CONFIG_VM_EVENT_COUNTERS is not set 18 18 # CONFIG_COMPAT_BRK is not set 19 - CONFIG_SLOB=y 19 + CONFIG_SLUB=y 20 + CONFIG_SLUB_TINY=y 20 21 CONFIG_MODULES=y 21 22 # CONFIG_BLOCK is not set 22 23 CONFIG_OPENRISC_BUILTIN_DTB="simple_smp"
+2 -1
arch/riscv/configs/nommu_k210_defconfig
··· 25 25 CONFIG_EMBEDDED=y 26 26 # CONFIG_VM_EVENT_COUNTERS is not set 27 27 # CONFIG_COMPAT_BRK is not set 28 - CONFIG_SLOB=y 28 + CONFIG_SLUB=y 29 + CONFIG_SLUB_TINY=y 29 30 # CONFIG_MMU is not set 30 31 CONFIG_SOC_CANAAN=y 31 32 CONFIG_NONPORTABLE=y
+2 -1
arch/riscv/configs/nommu_k210_sdcard_defconfig
··· 17 17 CONFIG_EMBEDDED=y 18 18 # CONFIG_VM_EVENT_COUNTERS is not set 19 19 # CONFIG_COMPAT_BRK is not set 20 - CONFIG_SLOB=y 20 + CONFIG_SLUB=y 21 + CONFIG_SLUB_TINY=y 21 22 # CONFIG_MMU is not set 22 23 CONFIG_SOC_CANAAN=y 23 24 CONFIG_NONPORTABLE=y
+2 -1
arch/riscv/configs/nommu_virt_defconfig
··· 22 22 # CONFIG_KALLSYMS is not set 23 23 # CONFIG_VM_EVENT_COUNTERS is not set 24 24 # CONFIG_COMPAT_BRK is not set 25 - CONFIG_SLOB=y 25 + CONFIG_SLUB=y 26 + CONFIG_SLUB_TINY=y 26 27 # CONFIG_MMU is not set 27 28 CONFIG_SOC_VIRT=y 28 29 CONFIG_NONPORTABLE=y
+2 -1
arch/sh/configs/rsk7201_defconfig
··· 10 10 CONFIG_PID_NS=y 11 11 CONFIG_BLK_DEV_INITRD=y 12 12 # CONFIG_AIO is not set 13 - CONFIG_SLOB=y 13 + CONFIG_SLUB=y 14 + CONFIG_SLUB_TINY=y 14 15 CONFIG_PROFILING=y 15 16 CONFIG_MODULES=y 16 17 # CONFIG_BLK_DEV_BSG is not set
+2 -1
arch/sh/configs/rsk7203_defconfig
··· 11 11 CONFIG_PID_NS=y 12 12 CONFIG_BLK_DEV_INITRD=y 13 13 CONFIG_KALLSYMS_ALL=y 14 - CONFIG_SLOB=y 14 + CONFIG_SLUB=y 15 + CONFIG_SLUB_TINY=y 15 16 CONFIG_PROFILING=y 16 17 CONFIG_MODULES=y 17 18 # CONFIG_BLK_DEV_BSG is not set
+2 -1
arch/sh/configs/se7206_defconfig
··· 21 21 CONFIG_KALLSYMS_ALL=y 22 22 # CONFIG_ELF_CORE is not set 23 23 # CONFIG_COMPAT_BRK is not set 24 - CONFIG_SLOB=y 24 + CONFIG_SLUB=y 25 + CONFIG_SLUB_TINY=y 25 26 CONFIG_PROFILING=y 26 27 CONFIG_MODULES=y 27 28 CONFIG_MODULE_UNLOAD=y
+2 -1
arch/sh/configs/shmin_defconfig
··· 9 9 # CONFIG_FUTEX is not set 10 10 # CONFIG_EPOLL is not set 11 11 # CONFIG_SHMEM is not set 12 - CONFIG_SLOB=y 12 + CONFIG_SLUB=y 13 + CONFIG_SLUB_TINY=y 13 14 # CONFIG_BLK_DEV_BSG is not set 14 15 CONFIG_CPU_SUBTYPE_SH7706=y 15 16 CONFIG_MEMORY_START=0x0c000000
+2 -1
arch/sh/configs/shx3_defconfig
··· 20 20 CONFIG_PID_NS=y 21 21 # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 22 22 CONFIG_KALLSYMS_ALL=y 23 - CONFIG_SLOB=y 23 + CONFIG_SLUB=y 24 + CONFIG_SLUB_TINY=y 24 25 CONFIG_PROFILING=y 25 26 CONFIG_KPROBES=y 26 27 CONFIG_MODULES=y
+3 -2
kernel/configs/tiny.config
··· 7 7 # CONFIG_KERNEL_LZO is not set 8 8 # CONFIG_KERNEL_LZ4 is not set 9 9 # CONFIG_SLAB is not set 10 - # CONFIG_SLUB is not set 11 - CONFIG_SLOB=y 10 + # CONFIG_SLOB_DEPRECATED is not set 11 + CONFIG_SLUB=y 12 + CONFIG_SLUB_TINY=y
+15 -2
mm/Kconfig
··· 219 219 and has enhanced diagnostics. SLUB is the default choice for 220 220 a slab allocator. 221 221 222 - config SLOB 222 + config SLOB_DEPRECATED 223 223 depends on EXPERT 224 - bool "SLOB (Simple Allocator)" 224 + bool "SLOB (Simple Allocator - DEPRECATED)" 225 225 depends on !PREEMPT_RT 226 226 help 227 + Deprecated and scheduled for removal in a few cycles. SLUB 228 + recommended as replacement. CONFIG_SLUB_TINY can be considered 229 + on systems with 16MB or less RAM. 230 + 231 + If you need SLOB to stay, please contact linux-mm@kvack.org and 232 + people listed in the SLAB ALLOCATOR section of MAINTAINERS file, 233 + with your use case. 234 + 227 235 SLOB replaces the stock allocator with a drastically simpler 228 236 allocator. SLOB is generally more space efficient but 229 237 does not perform as well on large systems. 230 238 231 239 endchoice 240 + 241 + config SLOB 242 + bool 243 + default y 244 + depends on SLOB_DEPRECATED 232 245 233 246 config SLUB_TINY 234 247 bool "Configure SLUB for minimal memory footprint"