Re: [PATCH][2.5] Add cachep->name to kmem_cache_destroy debug

Andrew Morton (akpm@digeo.com)
Sat, 14 Jun 2003 01:13:34 -0700


Zwane Mwaikambo <zwane@linuxpower.ca> wrote:
>
> kmem_cache_destroy: Can't free all objects cbc7af30 (dcookie_cache)
>
> I've been getting a number of these, perhaps it might be
> worthwhile adding the name too.
>
> ...
> - printk(KERN_ERR "kmem_cache_destroy: Can't free all objects %p\n",
> - cachep);
> + printk(KERN_ERR "kmem_cache_destroy: Can't free all objects %p (%s)\n",
> + cachep, cachep->name);

yes, but we have a nice little helper for that.

diff -puN mm/slab.c~kmem_cache_destroy-error-print mm/slab.c
--- 25/mm/slab.c~kmem_cache_destroy-error-print 2003-06-14 01:10:37.000000000 -0700
+++ 25-akpm/mm/slab.c 2003-06-14 01:13:12.000000000 -0700
@@ -1374,8 +1374,7 @@ int kmem_cache_destroy (kmem_cache_t * c
up(&cache_chain_sem);

if (__cache_shrink(cachep)) {
- printk(KERN_ERR "kmem_cache_destroy: Can't free all objects %p\n",
- cachep);
+ slab_error(cachep, "Can't free all objects");
down(&cache_chain_sem);
list_add(&cachep->next,&cache_chain);
up(&cache_chain_sem);

_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/