mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: linux-kernel@vger.kernel.org,
	Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	Christoph Lameter <cl@linux-foundation.org>
Subject: Re: [PATCH] kmemleak: Do not use off-slab management with SLAB_NOLEAKTRACE
Date: Fri, 16 Oct 2009 13:08:14 +0100	[thread overview]
Message-ID: <1255694894.3008.40.camel@pc1117.cambridge.arm.com> (raw)
In-Reply-To: <4AD770FB.5030104@cs.helsinki.fi>

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@I-love.SAKURA.ne.jp>
> > Cc: Pekka Enberg <penberg@cs.helsinki.fi>
> > Cc: Christoph Lameter <cl@linux-foundation.org>
> > Signed-off-by: Catalin Marinas <catalin.marinas@arm.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


  reply	other threads:[~2009-10-16 12:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14 15:31 Catalin Marinas
2009-10-15 18:59 ` Pekka Enberg
2009-10-16 12:08   ` Catalin Marinas [this message]
2009-10-16 12:17     ` Pekka Enberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1255694894.3008.40.camel@pc1117.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=cl@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®