v2 2026-10-25

SLUB_TINY改为启动参数 · v2

用 slab_tiny 启动参数替代 CONFIG_SLUB_TINY,重构 SLUB 阶数、调试与回收逻辑。

原始补丁链接

子 Patch(8)

1/8
mm, slab: refactor slab_min/max_order handling
Setting slab_min_order and slab_max_order as boot-time parameters currently has several not so great aspects: - slab_min_order is not checked against MAX_PAGE_ORDER - slab_min_order can raise slab_ma
2/8
mm, slab: introduce slab_debug=N
[mm, slab: introduce slab_debug=N] Enabling slab_debug has the side-effect of disabling all percpu caching of objects (now via sheaves), which can be sometimes useful for saving memory for e.g. kdump
3/8
mm, slab: rework KMALLOC_RECLAIM handling of SLUB_TINY
One (relatively minor) aspect of CONFIG_SLUB_TINY is the assumption that letting reclaimable and non-reclaimable caches merge will save more memory, which is more important on small systems than the p
4/8
mm, slab: make SLUB_TINY handling dynamic for sizing decisions
Enabling CONFIG_SLUB_TINY results in the caches’ min partial slabs threshold to be zero, thus every slab where all objects become free is freed immediately. It also sets the default slab_max_order to
5/8
mm, slab: convert CONFIG_SLUB_TINY checks to kmem_cache_debug()
CONFIG_SLUB_TINY shares several slowpaths with debugging as both of them avoid percpu caching of objects. With the goal of replacing the config with a boot-time decision, extend this sharing by hookin
6/8
mm, slab: remove remaining compile-time checks for CONFIG_SLUB_TINY
Remove several minor aspect of CONFIG_SLUB_TINY to allow it to be fully a boot-time decision: - remove check in cache_has_sheaves(), with no change to functionality but only on code elimination -
7/8
mm, slab: add slab_tiny boot param
[mm, slab: add slab_tiny boot param] In order to deprecate the CONFIG_SLUB_TINY option, introduce an early boot param slab_tiny to control the value of slab_tiny_enabled. As long as CONFIG_SLUB_TINY
8/8
mm, slab: deprecate CONFIG_SLUB_TINY and reduce its Kconfig effects
[mm, slab: deprecate CONFIG_SLUB_TINY and reduce its Kconfig effects] At this point CONFIG_SLUB_TINY only affects the default value of slab_tiny_enabled which has a boot-time parameter. Thus deprecate