path: root/mm/slob.c
diff options
authorPaul E. McKenney <>2021-01-07 13:46:11 -0800
committerPaul E. McKenney <>2021-03-08 14:18:46 -0800
commit5bb1bb353cfe343fc3c84faf06f72ba309fde541 (patch)
tree7a6f234b6247c3821fa2acb95c9a99e38ba24b65 /mm/slob.c
parenta38fd8748464831584a19438cbb3082b5a2dab15 (diff)
mm: Don't build mm_dump_obj() on CONFIG_PRINTK=n kernels
The mem_dump_obj() functionality adds a few hundred bytes, which is a small price to pay. Except on kernels built with CONFIG_PRINTK=n, in which mem_dump_obj() messages will be suppressed. This commit therefore makes mem_dump_obj() be a static inline empty function on kernels built with CONFIG_PRINTK=n and excludes all of its support functions as well. This avoids kernel bloat on systems that cannot use mem_dump_obj(). Cc: Christoph Lameter <> Cc: Pekka Enberg <> Cc: David Rientjes <> Cc: Joonsoo Kim <> Cc: <> Suggested-by: Andrew Morton <> Signed-off-by: Paul E. McKenney <>
Diffstat (limited to 'mm/slob.c')
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/slob.c b/mm/slob.c
index 0578429b991b..74d3f6e60666 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -461,11 +461,13 @@ out:
spin_unlock_irqrestore(&slob_lock, flags);
void kmem_obj_info(struct kmem_obj_info *kpp, void *object, struct page *page)
kpp->kp_ptr = object;
kpp->kp_page = page;
* End of slob allocator proper. Begin kmem_cache_alloc and kmalloc frontend.