summaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2008-04-23 22:31:08 +0300
committerPekka Enberg <penberg@cs.helsinki.fi>2008-04-27 18:26:06 +0300
commitd629d819579327267884a12de21ef6d4b539db88 (patch)
treea3f7c40fbcaef54b0dce0affc8cadf101ace046d /mm/slub.c
parent0701a9e649bf0ffdac0a761d3c3d1041f5375d90 (diff)
downloadtalos-op-linux-d629d819579327267884a12de21ef6d4b539db88.tar.gz
talos-op-linux-d629d819579327267884a12de21ef6d4b539db88.zip
slub: improve kmem_cache_destroy() error message
As pointed out by Ingo, the SLUB warning of calling kmem_cache_destroy() with cache that still has objects triggers in practice. So turn this WARN_ON() into a nice SLUB specific error message to avoid people confusing it to a SLUB bug. Cc: Ingo Molnar <mingo@elte.hu> Acked-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 39592b5ce68a..378d3f1b548f 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2426,8 +2426,11 @@ void kmem_cache_destroy(struct kmem_cache *s)
if (!s->refcount) {
list_del(&s->list);
up_write(&slub_lock);
- if (kmem_cache_close(s))
- WARN_ON(1);
+ if (kmem_cache_close(s)) {
+ printk(KERN_ERR "SLUB %s: %s called for cache that "
+ "still has objects.\n", s->name, __func__);
+ dump_stack();
+ }
sysfs_slab_remove(s);
} else
up_write(&slub_lock);
OpenPOWER on IntegriCloud