diff options
| -rw-r--r-- | mm/slab.h | 2 | ||||
| -rw-r--r-- | mm/slub.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/mm/slab.h b/mm/slab.h index 60e0df5bc5c2..041cda2d7395 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -591,7 +591,7 @@ static inline size_t cache_obj_ext_size(struct kmem_cache *s) if (IS_ENABLED(CONFIG_MEMCG)) sz += 1; - if (IS_ENABLED(CONFIG_MEM_ALLOC_PROFILING)) + if (slab_obj_ext_has_codetag()) sz += 1; return sizeof(struct slabobj_ext) * sz; diff --git a/mm/slub.c b/mm/slub.c index d2cbca1ade22..a24428ae32fb 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2064,6 +2064,9 @@ static inline void mark_obj_codetag_empty(const void *obj) struct slab *obj_slab; unsigned long slab_exts; + if (!slab_obj_ext_has_codetag()) + return; + if (is_kfence_address(obj)) return; @@ -2099,6 +2102,9 @@ static inline void handle_failed_objexts_alloc(struct slab *slab, { unsigned int stride; + if (!slab_obj_ext_has_codetag()) + return; + /* * If vector previously failed to allocate then we have live * objects with no tag reference. Mark all references in this |
