summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorHarry Yoo (Oracle) <harry@kernel.org>2026-07-13 23:28:50 +0900
committerVlastimil Babka (SUSE) <vbabka@kernel.org>2026-07-14 16:43:34 +0200
commit982e31382d9a1a3c8c4e6a13702a53711f4efe9f (patch)
treecd9e215935e28bfd28cfd68ea0f8af65a8ce8dcb /mm
parent1dba91a0493b7ffe9cbbcf7a8df1b361ddcac515 (diff)
downloadlinux-982e31382d9a1a3c8c4e6a13702a53711f4efe9f.tar.gz
linux-982e31382d9a1a3c8c4e6a13702a53711f4efe9f.tar.bz2
linux-982e31382d9a1a3c8c4e6a13702a53711f4efe9f.zip
mm/slab: decouple SLAB_NO_SHEAVES from SLAB_NO_OBJ_EXT
Bootstrap caches are created with SLAB_NO_OBJ_EXT to disallow sheaves and obj_exts. To allow disabling obj_exts while allowing sheaves, decouple SLAB_NO_SHEAVES from SLAB_NO_OBJ_EXT. Bootstrap caches now have both SLAB_NO_SHEAVES and SLAB_NO_OBJ_EXT. No functional change intended. Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org> Signed-off-by: Harry Yoo (Oracle) <harry@kernel.org> Reviewed-by: Suren Baghdasaryan <surenb@google.com> Link: https://patch.msgid.link/20260713-kmalloc-no-objext-v3-2-47c7bd138de7@kernel.org Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/slub.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/mm/slub.c b/mm/slub.c
index f9461a0c47d3..abe748b7dddb 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -7799,12 +7799,12 @@ static unsigned int calculate_sheaf_capacity(struct kmem_cache *s,
return 0;
/*
- * Bootstrap caches can't have sheaves for now (SLAB_NO_OBJ_EXT).
+ * Bootstrap caches can't have sheaves for now (SLAB_NO_SHEAVES).
* SLAB_NOLEAKTRACE caches (e.g., kmemleak's object_cache) must not
* have sheaves to avoid recursion when sheaf allocation triggers
* kmemleak tracking.
*/
- if (s->flags & (SLAB_NO_OBJ_EXT | SLAB_NOLEAKTRACE))
+ if (s->flags & (SLAB_NO_SHEAVES | SLAB_NOLEAKTRACE))
return 0;
/*
@@ -8586,7 +8586,8 @@ void __init kmem_cache_init(void)
create_boot_cache(kmem_cache_node, "kmem_cache_node",
sizeof(struct kmem_cache_node),
- SLAB_HWCACHE_ALIGN | SLAB_NO_OBJ_EXT, 0, 0);
+ SLAB_HWCACHE_ALIGN | SLAB_NO_SHEAVES | SLAB_NO_OBJ_EXT,
+ 0, 0);
hotplug_node_notifier(slab_memory_callback, SLAB_CALLBACK_PRI);
@@ -8596,7 +8597,8 @@ void __init kmem_cache_init(void)
create_boot_cache(kmem_cache, "kmem_cache",
offsetof(struct kmem_cache, per_node) +
nr_node_ids * sizeof(struct kmem_cache_per_node_ptrs),
- SLAB_HWCACHE_ALIGN | SLAB_NO_OBJ_EXT, 0, 0);
+ SLAB_HWCACHE_ALIGN | SLAB_NO_SHEAVES | SLAB_NO_OBJ_EXT,
+ 0, 0);
kmem_cache = bootstrap(&boot_kmem_cache);
kmem_cache_node = bootstrap(&boot_kmem_cache_node);