summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorVlastimil Babka (SUSE) <vbabka@kernel.org>2026-07-27 14:54:06 +0200
committerVlastimil Babka (SUSE) <vbabka@kernel.org>2026-08-04 12:26:55 +0200
commitd4404b0f5b8b0ff4656d018a0ddfafdbd78879e2 (patch)
tree257220f6db46d1fb702beca9fe44941cd15e2912 /scripts
parent7def2e8549e5186cd4de97ab5ce56f7944d3da59 (diff)
downloadlinux-next-d4404b0f5b8b0ff4656d018a0ddfafdbd78879e2.tar.gz
linux-next-d4404b0f5b8b0ff4656d018a0ddfafdbd78879e2.zip
mm/slab: stop allocating objcg pointers when unnecessary
Start using the slab_needs_objcg() helper to calculate slabobj_ext size. Caches that we know to never need objcg pointers (currently KMALLOC_NORMAL caches) will thus stop wasting memory on them when memory allocation profiling is enabled. For things to work properly, we need to also add slab_needs_objcg() checks to mem_cgroup_from_obj_slab() and memcg_slab_free_hook(), because when obj_exts array exists for a slab only due to mem_alloc profiling, we would otherwise attempt to access a non-existing objcg pointer in that slab. In slab_obj_ext_[set_]objcg() add debug warnings if called on a slab where slab_needs_objcg() is false. Reviewed-by: Hao Li <hao.li@linux.dev> Link: https://patch.msgid.link/20260727-b4-objext_split-v3-12-c29ef0f1f257@kernel.org Reviewed-by: Harry Yoo <harry@kernel.org> Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions