]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/slab: only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches
authorHarry Yoo <harry.yoo@oracle.com>
Tue, 27 Jan 2026 10:31:51 +0000 (19:31 +0900)
committerVlastimil Babka <vbabka@suse.cz>
Wed, 4 Feb 2026 09:05:36 +0000 (10:05 +0100)
commit2f35fee943435b5b1a3e403c7fb9bd19727754d8
tree57378d3d113d25aadcca59ead7fbb0f6ca209e3d
parenta77d6d338685025cbf84f6e3abd92a8e59a4d894
mm/slab: only allow SLAB_OBJ_EXT_IN_OBJ for unmergeable caches

While SLAB_OBJ_EXT_IN_OBJ allows to reduce memory overhead to account
slab objects, it prevents slab merging because merging can change
the metadata layout.

As pointed out Vlastimil Babka, disabling merging solely for this memory
optimization may not be a net win, because disabling slab merging tends
to increase overall memory usage.

Restrict SLAB_OBJ_EXT_IN_OBJ to caches that are already unmergeable for
other reasons (e.g., those with constructors or SLAB_TYPESAFE_BY_RCU).

Suggested-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
Link: https://patch.msgid.link/20260127103151.21883-3-harry.yoo@oracle.com
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slab.h
mm/slab_common.c
mm/slub.c