[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1255694894.3008.40.camel@pc1117.cambridge.arm.com>
Date: Fri, 16 Oct 2009 13:08:14 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Pekka Enberg <penberg@...helsinki.fi>
Cc: linux-kernel@...r.kernel.org,
Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
Christoph Lameter <cl@...ux-foundation.org>
Subject: Re: [PATCH] kmemleak: Do not use off-slab management with
SLAB_NOLEAKTRACE
Hi Pekka,
On Thu, 2009-10-15 at 21:59 +0300, Pekka Enberg wrote:
> Catalin Marinas wrote:
> > With the slab allocator, if off-slab management is enabled for the
> > kmem_caches used by kmemleak, it leads to recursive calls into
> > kmemleak_alloc(). Off-slab management can be triggered by other config
> > options increasing the slab size, e.g. DEBUG_PAGEALLOC.
> >
> > Reported-by: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
> > Cc: Pekka Enberg <penberg@...helsinki.fi>
> > Cc: Christoph Lameter <cl@...ux-foundation.org>
> > Signed-off-by: Catalin Marinas <catalin.marinas@....com>
>
> Forcing slabs to use on-slab management is pretty bad from memory
> consumption point of view. Wouldn't it be better to annotate the
> recursive calls somehow?
The are annotated using SLAB_NOLEAKTRACE but off-slab management uses a
general cachep and we cannot use this flag on them as we end up ignoring
kmalloc allocations. An alternative is to use GFP_ flag rather than a
SLAB_ one to track the recursive calls.
I could also rework the way hooks were added to slab.c but currently
they follow the same places as kmemcheck_slab_alloc and
lockdep_trace_alloc.
Anyway, the kmemleak caches only need off-slab management when
DEBUG_PAGEALLOC is enabled but in this case the memory consumption is
high anyway.
--
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists