summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-05-30 21:49:51 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-30 21:49:51 -0400
commit0d63bd45cc2aa8ed98e6cf3f62ac133599fa8177 (patch)
tree2bf3ca698c5fec1b7fa4ea1c912deea4725758e9 /include/linux
parenta7eab32c3580c6f4c051c5a16cad8877307b853f (diff)
verify_obj_has_alloc_tag()memalloc_prof_debug
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/alloc_tag.h4
-rw-r--r--include/linux/slab.h6
2 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/alloc_tag.h b/include/linux/alloc_tag.h
index abd24016a900..48d587b0a37c 100644
--- a/include/linux/alloc_tag.h
+++ b/include/linux/alloc_tag.h
@@ -127,7 +127,9 @@ static inline void alloc_tag_add_check(union codetag_ref *ref, struct alloc_tag
static inline void alloc_tag_sub_check(union codetag_ref *ref)
{
- WARN_ONCE(ref && !ref->ct, "alloc_tag was not set\n");
+ if (ref && !ref->ct)
+ printk(KERN_WARNING "alloc_tag was not set\n");
+ //WARN_ONCE(ref && !ref->ct, "alloc_tag was not set\n");
}
#else
static inline void alloc_tag_add_check(union codetag_ref *ref, struct alloc_tag *tag) {}
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 7247e217e21b..c5df1534ebf3 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -835,6 +835,12 @@ unsigned int kmem_cache_size(struct kmem_cache *s);
*/
size_t kmalloc_size_roundup(size_t size);
+#ifdef CONFIG_MEM_ALLOC_PROFILING_DEBUG
+void verify_slab_obj_has_alloc_tag(void *ptr);
+#else
+static inline void verify_slab_obj_has_alloc_tag(void *ptr) {}
+#endif
+
void __init kmem_cache_init_late(void);
#endif /* _LINUX_SLAB_H */