Re: [PATCH 2.6.28-rc5 03/11] kmemleak: Add the memoryallocation/freeing hooks

From: Catalin Marinas
Date: Mon Nov 24 2008 - 05:44:16 EST


On Mon, 2008-11-24 at 12:35 +0200, Pekka Enberg wrote:
> On Mon, 2008-11-24 at 10:18 +0000, Catalin Marinas wrote:
> > My understanding is that the ->s_mem value points to the slab itself but
> > the same pointer might actually be the beginning of an allocated memory
> > block, hence we get at least one reference to this block.
>
> Yes, ->s_mem points to the first object in the slab if CONFIG_DEBUG_SLAB
> is disabled.
>
> So if I understood this right, in case the first object in the slab is
> leaked (it's allocated but no one references to it), we want to make
> sure kmemleak doesn't see the ->s_mem link which would cause a false
> negative (i.e. a leak that is not reported).
>
> Did I get it correct this time?

Yes.

--
Catalin

--
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/