Re: [PATCH] mm/slab: add a leak decoder callback

From: Liu Bo
Date: Tue Jan 15 2013 - 20:02:01 EST


On Tue, Jan 15, 2013 at 04:30:52PM +0000, Christoph Lameter wrote:
> On Mon, 14 Jan 2013, Liu Bo wrote:
>
> > This adds a leak decoder callback so that kmem_cache_destroy()
> > can use to generate debugging output for the allocated objects.
>
> Interesting idea.
>
> > @@ -3787,6 +3789,9 @@ static int slab_unmergeable(struct kmem_cache *s)
> > if (s->ctor)
> > return 1;
> >
> > + if (s->decoder)
> > + return 1;
> > +
> > /*
> > * We may have set a slab to be unmergeable during bootstrap.
> > */
>
> The merge processing occurs during kmem_cache_create and you are setting
> up the decoder field afterwards! Wont work.

You're right, I miss the lock part.

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