From 8ea8ea31e78ea5dcbdfe454bb4a3c20437f37716 Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Sun, 31 Jul 2022 12:42:21 -0700 Subject: lib: add codetag reference into slabobj_ext To store code tag for every slab object, a codetag reference is embedded into slabobj_ext when CONFIG_MEM_ALLOC_PROFILING=y. Signed-off-by: Suren Baghdasaryan Co-developed-by: Kent Overstreet Signed-off-by: Kent Overstreet --- include/linux/memcontrol.h | 5 +++++ lib/Kconfig.debug | 1 + 2 files changed, 6 insertions(+) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index c3c23eadf389..2618de955e34 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -1598,7 +1598,12 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, * if MEMCG_DATA_OBJEXTS is set. */ struct slabobj_ext { +#ifdef CONFIG_MEMCG_KMEM struct obj_cgroup *objcg; +#endif +#ifdef CONFIG_MEM_ALLOC_PROFILING + union codetag_ref ref; +#endif } __aligned(8); static inline void __inc_lruvec_kmem_state(void *p, enum node_stat_item idx) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 1bada65d7774..5fc17feb7f6d 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1020,6 +1020,7 @@ config MEM_ALLOC_PROFILING select CODE_TAGGING select LAZY_PERCPU_COUNTER select PAGE_EXTENSION + select SLAB_OBJ_EXT help Track allocation source code and record total allocation size initiated at that code location. The mechanism can be used to track -- cgit v1.2.3