]> Git Repo - linux.git/commit - mm/slab_common.c
mm/slab_common: drop kmem_alloc & avoid dereferencing fields when not using
authorHyeonggon Yoo <[email protected]>
Wed, 17 Aug 2022 10:18:24 +0000 (19:18 +0900)
committerVlastimil Babka <[email protected]>
Thu, 1 Sep 2022 09:44:26 +0000 (11:44 +0200)
commit2c1d697fb8ba6d2d44f914d4268ae1ccdf025f1b
treea2e3b945b6a96e59c319083739023ba52e932fcb
parent11e9734bcb6a7361943f993eba4e97f5812120d8
mm/slab_common: drop kmem_alloc & avoid dereferencing fields when not using

Drop kmem_alloc event class, and define kmalloc and kmem_cache_alloc
using TRACE_EVENT() macro.

And then this patch does:
   - Do not pass pointer to struct kmem_cache to trace_kmalloc.
     gfp flag is enough to know if it's accounted or not.
   - Avoid dereferencing s->object_size and s->size when not using kmem_cache_alloc event.
   - Avoid dereferencing s->name in when not using kmem_cache_free event.
   - Adjust s->size to SLOB_UNITS(s->size) * SLOB_UNIT in SLOB

Cc: Vasily Averin <[email protected]>
Suggested-by: Vlastimil Babka <[email protected]>
Signed-off-by: Hyeonggon Yoo <[email protected]>
Reviewed-by: Vlastimil Babka <[email protected]>
Signed-off-by: Vlastimil Babka <[email protected]>
include/trace/events/kmem.h
mm/slab.c
mm/slab_common.c
mm/slob.c
mm/slub.c
This page took 0.054047 seconds and 4 git commands to generate.